Setup Google Authentication

  1. Go to your Google Cloud Console credentials screen
  2. Make sure the right project is selected
  3. Click the button to Create Credentials, and select OAuth Client ID
  4. If you haven't setup a Consent Screen, it will prompt you to configure one
  5. For the Application Type select Web Application
  6. For the name enter your app name or Web App
  7. Add Authorized Javascrcipt origins
    For dev:http://localhost:3000
    For prod:https://yourdomain.com
  8. Add Authorized redirect URIs
    For dev:http://localhost:3000/api/auth/callback/google
    For prod:https://yourdomain.com/api/auth/callback/google
  9. Click the Create button
  10. Copy the Client ID and Client Secret
  11. Add your credentials to your .env file:AUTH_GOOGLE_ID=your_client_id
    AUTH_GOOGLE_SECRET=your_client_secret
  12. Uncomment the env variable checks in src/env.ts

You can now login with Google on your app!