Setup Google Authentication
- Go to your Google Cloud Console credentials screen
- Make sure the right project is selected
- Click the button to Create Credentials, and select OAuth Client ID
- If you haven't setup a Consent Screen, it will prompt you to configure one
- For the Application Type select Web Application
- For the name enter your app name or Web App
- Add Authorized Javascrcipt originsFor dev:
http://localhost:3000
For prod:https://yourdomain.com
- Add Authorized redirect URIsFor dev:
http://localhost:3000/api/auth/callback/google
For prod:https://yourdomain.com/api/auth/callback/google
- Click the Create button
- Copy the Client ID and Client Secret
- Add your credentials to your .env file:
AUTH_GOOGLE_ID=your_client_id
AUTH_GOOGLE_SECRET=your_client_secret - Uncomment the env variable checks in
src/env.ts
You can now login with Google on your app!