Last active
July 10, 2017 18:17
-
-
Save blehr/b79115066d975d8e3f7afcced8221d60 to your computer and use it in GitHub Desktop.
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
passport.use(new GoogleStrategy({ | |
clientID: configAuth.googleAuth.clientID, | |
clientSecret: configAuth.googleAuth.clientSecret, | |
callbackURL: configAuth.googleAuth.callbackURL, | |
passReqToCallback: true | |
}, | |
function(req, accessToken, refreshToken, params, profile, done) { | |
/* | |
params = { | |
access_token: 'Long_string', | |
token_type: 'Bearer', | |
expires_in: 3599, // seconds | |
id_token: 'Longer_string' | |
} | |
*/ | |
// find expiry_date so it can be save in the database, along with access and refresh token | |
const expiry_date = moment().add(params.expires_in, "s").format("X"); | |
... | |
} | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment