Create a Project
-
You need to create a Google Cloud project. Go to the Google Cloud Console and create a new project.
-
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.
-
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 uselocalhost: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