使用Passport.js有沒有辦法讓我爲相同的路由指定多個身份驗證提供程序?passport.js與多個身份驗證提供程序?
例如(從護照指南)我可以在下面的示例路線上使用本地和Facebook和Twitter策略?
app.post('/login',
passport.authenticate('local'), /* how can I add other strategies here? */
function(req, res) {
// If this function gets called, authentication was successful.
// `req.user` contains the authenticated user.
res.redirect('/users/' + req.user.username);
});
你爲什麼希望多策略混合成一條路由後? – damphat