-
Notifications
You must be signed in to change notification settings - Fork 1
Backend Architecture
We are using Payload CMS for the backend.
-
To create a Google OAuth App, you'll need to head over to Google Cloud Console.
-
Create a new project or use an existing project.
-
Navigate to
APIs & Services
->Credentials
->+ Create Credentials
->OAuth Client ID
. -
You'll want to add the following Authorised JavaScript origins:
http://localhost:3000
https://your-website.fly.dev
- You'll want to add the following Authorised redirect URIs:
http://localhost:3000/api/auth/google/callback
https://your-website.fly.dev/api/auth/google/callback/
- Copy the
Client ID
andClient Secret
.
In this project, we are using JWT (with jsonwebtoken) with authentication to pass user data and the Google access_token
. JWT tokens require a secret which is defined in env
.
To generate a JWT secret, you can run node -e "console.log(crypto.randomBytes(64).toString('hex'))"
in your terminal to generate such.
As shown in .env.example
, the environment variable is named JWT_SECRET
, so you can paste this key and value into your env file.