When I go to localhost:8000/auth/google, google signup page loads, after signup passport redirects to callbackUrl but without executing the anonymous callback function(accessToken, refreshToken, profile,done). If I console.print accessToken, refreshToken, profile nothing happens.
const passport = require('passport');
const GoogleStrategy = require('passport-google-oauth20').Strategy;
const keys = require('../config/keys')
const mongoose= require('mongoose')
const User = mongoose.model('User')
passport.use(
new GoogleStrategy({
clientID: keys.googleClientID,
clientSecret: keys.googleClientSecret,
callbackURL: "/auth/google/callback",
passReqToCallback : true
},
(accessToken, refreshToken, profile,done)=>{
console.log("allgood",accessToken)
User.findOne({googleId:profile.id})
.then((existingUser) => {
if (existingUser) {
}else{
new User({googleId:profile.id}).save();
}
})
})
)