在设备上设置 ssl [英] setting up ssl on devise

查看:15
本文介绍了在设备上设置 ssl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要求对设备上的用户资源进行 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 上找不到任何文档,尽管我在 google 群组中发现了一些指向它的死链接.

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 不会作为选项工作,但这可能会:

:constraints won't work as option, but this probably will:

constraints :protocol => "https" do
  devise_for :users
end

这篇关于在设备上设置 ssl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆