Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. passport.use( //The
  2. new GoogleStrategy({
  3. callbackURL: '/auth/google/redirect',
  4. clientID: keys.google.clientID,
  5. clientSecret: keys.google.clientSecret
  6. //options for strategy to configure
  7. }, (accessToken, refreshToken, profile, done) => {
  8. //check if user already exist etc
  9.  
  10. })
  11.  
  12. ////On the routes file
  13. router.get('/google/redirect',passport.authenticate('google'), (req, res) => { //Middleware forces authorisation from passport before allowed into the profile.
  14.  
  15. res.redirect("/profile/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement