SHARE
TWEET

Untitled

a guest Aug 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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/")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top