Created
December 10, 2019 13:30
-
-
Save jackrobertscott/c9a996458308730be580733dc3e043b3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import * as queryString from 'query-string'; | |
const stringifiedParams = queryString.stringify({ | |
client_id: process.env.CLIENT_ID_GOES_HERE, | |
redirect_uri: 'https://www.example.com/authenticate/google', | |
scope: [ | |
'https://www.googleapis.com/auth/userinfo.email', | |
'https://www.googleapis.com/auth/userinfo.profile', | |
].join(' '), // space seperated string | |
response_type: 'code', | |
access_type: 'offline', | |
prompt: 'consent', | |
}); | |
const googleLoginUrl = `https://accounts.google.com/o/oauth2/v2/auth?${stringifiedParams}`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mal