Authlogic 未提供凭据
我也在使用 MongoMapper、Authlogic 和这些代码, https://gist.github.com/444888/e8b28196c4f4452a06b89d 566a6a245eae1e9d92 。
当我跳过身份验证以直接登录用户时遇到问题。 根据Authlogic,我只需要输入这行代码:
user = User.find(1234)
UserSession.create(user, true)
它就会自动登录用户。但我总是得到这样的输出:
#<UserSession: no credentials provided>
是否有任何配置需要修复或更改?就像在 UserSession 中一样。
提前致谢。
I'm using MongoMapper, Authlogic and these codes too, https://gist.github.com/444888/e8b28196c4f4452a06b89d566a6a245eae1e9d92.
I'm having trouble when I'm skipping the authentication to log the user in directly.
According to the Authlogic, I just need to input these line of codes:
user = User.find(1234)
UserSession.create(user, true)
and it will automatically logs in the user. But I always got this output:
#<UserSession: no credentials provided>
Is there any configuration that I need to fix or change? Like in UserSession.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是我使用 mongomapper/authlogic 通过 API 令牌登录人员的方式
这是我在 authlogic UserSession.create(@user)给予unauthorized_record
在该答案中,原始发布者指出“保存用户对象时未设置persistence_token!”
This is how I log people in through an API token using mongomapper/authlogic
This is a dupe of the answer I gave over on authlogic UserSession.create(@user) giving unauthorized_record
In that answer, the original poster stated "persistence_token was not being set when the user object was saved!"