Docs
Google OAuth
Google OAuth
ZexaNext uses Auth.js for authentication. To setup Google OAuth in ZexaNext
- Create a new project on Google Cloud
- Go to
APIs & Services
then Credentials - Click on [Configure Consent Screen]
- Fill in all the info. Add userinfo.email and userinfo.profile to scope. Add yourself as a test user.
- Submit
- Go to Credentials and click "Create Credentials", then "OAuth Client ID"
- Select "Web Application"
- Add http://localhost:3000 and https://yoursitename.com to Authorized JavaScript Origins.
- Add http://localhost:3000/api/auth/callback/google and https://yoursitename.com/api/auth/callback/google to Authorized redirect URLs.
- Click Submit
- Copy and paste the Client ID and Client Secret into the .env file:
- 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.
- Open
config/index.ts
and set google inOAuthOptions
to true to show Google OAuth in the login page.
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).