Docs
Google OAuth

Google OAuth

ZexaNext uses Auth.js for authentication. To setup Google OAuth in ZexaNext

  1. Create a new project on Google Cloud
  2. Go to APIs & Services then Credentials
  3. Click on [Configure Consent Screen]
  4. Fill in all the info. Add userinfo.email and userinfo.profile to scope. Add yourself as a test user.
  5. Submit
  6. Go to Credentials and click "Create Credentials", then "OAuth Client ID"
  7. Select "Web Application"
  8. Add http://localhost:3000 and https://yoursitename.com to Authorized JavaScript Origins.
  9. Add http://localhost:3000/api/auth/callback/google and https://yoursitename.com/api/auth/callback/google to Authorized redirect URLs.
  10. Click Submit
  11. Copy and paste the Client ID and Client Secret into the .env file:
# for Google Sign up
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
  1. Go to "OAuth Consent Screen" and click "Publish App".

Google might request you to verify your domain in Google Search Console. It requires you to configure a CNAME or TXT DNS record.

  1. Open config/index.ts and set google in OAuthOptions to true to show Google OAuth in the login page.
const OAuthOptions = {
  google: true,
  github: false
}

You can already login with Google on localhost. On production, it will work too but show a warning until you're verified (takes a few days).