Create a Project

  1. You need to create a Google Cloud project. Go to the Google Cloud Console and create a new project.

  2. Go to the APIs & Services > OAuth consent screen, set the User Type to External, add your domain to the Authorized domains, and fill in the required fields.

  3. Create credentials at APIs & Services > Credentials. Select Create Credentials and choose OAuth client ID.

    Add your domain to Authorized JavaScript origins and set the Authorized redirect URI to https://{yourdomain}/auth/verify/google. In development, you can use localhost:3000 (or another port) as the domain.

Set Variables

You will get the client ID and client secret from the OAuth client ID creation. Add the following environment variables to your .env file:

.env

GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= GOOGLE_REDIRECT_URI=