ben pasaport-google-oauth kullanarak aşağıdaki Düğüm kodunu ...Pasaport-Google OAuth Geri arama
app.get('/auth/google', passport.authenticate('google', { scope : ['profile', 'email'] }));
app.get('/auth/google/callback', function(req,res) {
console.log("callback");
passport.authenticate('google', {
successRedirect : '/signin',
failureRedirect : '/signin'
});
});
ve ... sahip
sorundurpassport.serializeUser(function(user, done) {
console.log("ser");
done(null, user.id);
});
passport.deserializeUser(function(id, done) {
console.log("des");
User.findById(id, function(err, user) {
done(err, user);
});
});
passport.use(new GoogleStrategy({
clientID : 'id',
clientSecret : 'key',
callbackURL : 'http://host/auth/google/callback',
},
function(token, rtoken, profile, done) {
console.log("proc");
console.log(profile);
done(null, profile);
}));
, geri arama Çalışmıyor çağrılıyor ama başka bir şey olmaz. İşleme işlevi asla vurmaz. Geri arama zaman aşımına uğradı. Yanlış gittiğim herhangi bir fikir var mı?
'console.log (" callback "); – xShirase
Ayrıca, rota/rotada neye benziyorsunuz? Ayrıca, geri arama bir get veya post olmalıdır. Bence genellikle bir yazı. –
belki sizin sorununuz GoogleStrategy içinde. Bunu deneyin: var GoogleStrategy = gerekli ('passport-google-oauth'). OAuth2Strategy; – Dyrk