rails 3 + devise: how do I make the email confirmation links use secure https (not http)

后端 未结 2 1061
醉话见心
醉话见心 2021-02-18 21:34

How to I tell Devise to use https (not http) for all the account confirmation and password reminder etc links?

[note: I\'m not looking for a solution to redirect all

相关标签:
2条回答
  • 2021-02-18 21:52

    To set the protocol but also a subdirectory :

    config.action_mailer.default_url_options = {
            :host => "www.example.com",
            :protocol => 'https',
            :only_path => false,
            :script_name => "/app" #add this attribute if your app is deployed in a subdirectory
        }
    

    Source

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

    default_url_options accepts the same hash parameters as url_for. So you should be able to do this:

    config.action_mailer.default_url_options = { :protocol => 'https', :host => 'app1.mydomain.com' }
    
    0 讨论(0)
提交回复
热议问题