Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- passport.use( //The
- new GoogleStrategy({
- callbackURL: '/auth/google/redirect',
- clientID: keys.google.clientID,
- clientSecret: keys.google.clientSecret
- //options for strategy to configure
- }, (accessToken, refreshToken, profile, done) => {
- //check if user already exist etc
- })
- ////On the routes file
- router.get('/google/redirect',passport.authenticate('google'), (req, res) => { //Middleware forces authorisation from passport before allowed into the profile.
- res.redirect("/profile/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement