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