【发布时间】:2014-03-24 16:00:09
【问题描述】:
我无法追踪到这一点,但是对于我的设置,isAuthenticated 即使在成功登录后也总是返回 false。这是护照代码:
req.isAuthenticated = function() {
var property = 'user';
if (this._passport && this._passport.instance._userProperty) {
property = this._passport.instance._userProperty;
}
return (this[property]) ? true : false;
};
但是快速浏览一下,我在本地策略的任何地方都没有看到 _userProperty 属性(抱歉,如果我看的不够仔细),所以我想这可能就是它总是返回 false 的原因?
我会留下我的应用程序代码的代码示例,但我觉得快速查看我正在进行的工作的 repo 可能更容易: passport api token sessionless
最终,我的目标是让该样板项目的注销正常工作(目前它没有)。
【问题讨论】: