MongoDB 和 Authlogic,有什么问题吗? (蒙戈映射器)
Authlogic 本身对于 MongoDB(特别是 mongomapper)来说似乎过于以活跃记录为中心,如下所示: http://github.com/binarylogic/authlogic/issues#issue/15。
然而,有一个有趣的 mongo 的 authlogic 插件,看起来非常棒,而且很简单。
有没有人使用过这个,或者对 authlogic mongodb 实现有任何经验/建议?
Authlogic, by itself, seems to be too active record centric for MongoDB (specifically mongomapper) as per: http://github.com/binarylogic/authlogic/issues#issue/15.
However, there's an interesting authlogic plugin for mongo that looks pretty awesome, and simple.
Has anyone used this, or have any experience/recommendations for an authlogic mongodb implementation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我继续并在峰值中实现了它,从restful_authentication更改为authlogic。我发现的唯一问题是需要添加以下代码
/app/models/user.rb
在创建新的 user_session 时请求引用的表名称,所以我添加了它,一切都很棒而且很高兴。
强烈推荐。
更新
一旦我开始使用多个用户,登录功能就不再对我有用。如果您使用第一个用户的密码,它会让您登录,但其他都不重要。
我切换到这个初始化程序: https://gist.github.com/444888/e8b28196c4f4452a06b89d566a6a 245eae1e9d92,这很好。我还建议查看 Devise,它为 mongomapper 提供了开箱即用的功能。
I went ahead and inplemented it in a spike, changing from restful_authentication to authlogic. The only gotcha I found was needing to add the following code
/app/models/user.rb
The quoted_table_name was being requested when creating a new user_session, so I added it and everything was great and happy.
Highly recommend.
UPDATE
Once I started using multiple users, the login features stopped working for me. It would log you in if you use the password of the first user, but nothing else mattered.
I switched to this initializer: https://gist.github.com/444888/e8b28196c4f4452a06b89d566a6a245eae1e9d92, which has been nice. I also recommend looking at Devise, which has this straight out of the box for mongomapper.