【发布时间】:2015-01-08 03:17:59
【问题描述】:
我正在尝试将 LinkedInStrategy 与现有的 LocalStrategy 结合起来(用户已通过身份验证)。
这是来自护照文档的示例:
schema.statics.passportLinkedInStrategy = function(token, tokenSecret, profile, done) {
// asynchronous verification, for effect...
process.nextTick(function () {
// To keep the example simple, the user's LinkedIn profile is returned to
// represent the logged-in user. In a typical application, you would want
// to associate the LinkedIn account with a user record in your database,
// and return that user instead.
return done(null, profile);
});
};
问题是我无权访问req.user 来检查此回调中的现有会话。
知道我可以/应该怎么做吗?
【问题讨论】:
标签: node.js passport.js