0
我想通过护照的twitter策略来验证用户,但不签署用户。我所要做的就是存储他们的凭据,以便我可以在稍后推特给他们的帐户,米没有看到这是如何可能的。passportjs获取用户twitter凭证
它看起来像你必须调用done
回调,然后将用户ID存储在会话中。我的用户已经使用我的应用程序进行了身份验证,但是想要附加一个或多个可以选择在稍后推迟发送的Twitter帐户。
这里是我的Twitter战略
passport.use(new TwitterStrategy({
consumerKey: '...',
consumerSecret: '...',
callbackURL: '/add/twitter/callback',
passReqToCallback: true
},
function(req, token, tokenSecret, profile, done) {
process.nextTick(function() {
//save the users twitter credentials for use later on and call
//my custom callback here ...
});
});
}));
我还使用express.js所以这里是我的路线
router
.get('/auth/twitter', passport.authenticate('twitter'))
.get('/auth/twitter/callback',
passport.authenticate('twitter'), function(req, res) {
console.log('made it here');
// Successful authentication
res.render('manager/add-twitter', {});
});
是否有可能有一个被不管什么开了自定义回调?
对此的缺乏答案并没有给我希望:/ – imns 2014-10-10 16:22:49