谁能帮我解决这个问题?回调永远不会结束。我遵循了护照 Facebook 指南和护照-Facebook 指南,都遇到了同样的问题。这是我的代码:
passport.use(new FacebookStrategy({
clientID: FACEBOOK_APP_ID,
clientSecret: FACEBOOK_APP_SECRET,
callbackURL: "http://localhost:3000/auth/facebook/callback"
},
function(accessToken, refreshToken, profile, done) {
User.findOrCreate({ facebookId: profile.id },{name:profile.displayName},
function (err, user) {
return done(err, user);
});
}
));
app.get('/auth/facebook', passport.authenticate('facebook'));
app.get('/auth/facebook/callback',
passport.authenticate('facebook', { failureRedirect: '/error',
successRedirect: '/success' }));
配置和依赖
node.js 版本 0.10
“快递”:“3.2.1”,
“护照”:“0.1.16”,
“护照脸书”:“0.1.5”,
“贝宝-ipn”:“1.0.1”,
“ejs”:“0.8.3”,
“续集”:“1.7.0-alpha1”,
“温斯顿”:“0.7.1”,
“mysql”:“2.0.0-alpha8”