setting up ssl on devise

前端 未结 3 709
孤独总比滥情好
孤独总比滥情好 2021-02-01 21:30

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, :cons         


        
相关标签:
3条回答
  • 2021-02-01 21:54

    Integrate SSL Requirement into your app and using Devise. The answer didn't work but this did for me, especially since I was using SSL Requirement already.

    0 讨论(0)
  • 2021-02-01 21:56

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

    constraints :protocol => "https" do
      devise_for :users
    end
    
    0 讨论(0)
  • 2021-02-01 22:01

    I suggest using Rack::SSL, maybe with Rack::SslEnforcer for more configuration options.

    0 讨论(0)
提交回复
热议问题