-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14d8bec
commit 3f005eb
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Introduction | ||
This is a simple Google OAuth login example using Fastify and Passport. | ||
|
||
# Setup | ||
[Fastify-secure-session](https://www.npmjs.com/package/fastify-secure-session) is being used for session management. You will need a secret-key to run this code. | ||
|
||
`npx fastify-secure-session > secret-key` | ||
|
||
Place the secret key in the base folder. | ||
|
||
You will need to create a **.env** file in the base folder with these two variables that you will get from your Google Console | ||
``` | ||
AUTH0_CLIENT_ID=clientID from Google | ||
AUTH0_CLIENT_SECRET=Secret from Google | ||
``` | ||
Make sure you add the gmail address you plan to login with to the allowed users list | ||
|
||
# Run | ||
|
||
To run the code | ||
`npm run start` | ||
and visit http://localhost:8080/ |