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/")