在设计上设置ssl [英] setting up ssl on devise
本文介绍了在设计上设置ssl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要为devise上的用户资源要求ssl身份验证。我期望像在rails中一样简单,例如:
I'd like to require ssl authentication for the user resource on devise. I was expecting that to be as simple as it is in rails, like:
devise_for :users, :constraints => { :protocol => "https" }
此外,我找不到devise的github的任何文档,发现一些死链接指向它在谷歌组。
Also, I couldn't find any documentation on devise's github, though I've found some dead links pointing to it at the google groups.
有人有一个提示如何让它的工作很容易?我以为我会很简单,因为插件的流行度
Does anybody has a hint on how to get it working easily? I thought I'd be simple, given the popularity of the plugin
推荐答案
:约束不能作为选项,但是可能会:
:constraints won't work as option, but this probably will:
constraints :protocol => "https" do
devise_for :users
end
这篇关于在设计上设置ssl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文