0
votes

I am using Devise 3.5.2 to handle user confirmations in my Rails 4.2 app. Confirmation emails are received correctly. However the confirmation link in the email does not include the protocol at all. This is not a problem in development but will be in production.

For instance, instead of being this:

http://localhost:3000/users/confirmation?confirmation_token=eBjysKrWkFHBf46qUf1Q

I get this:

localhost:3000/users/confirmation?confirmation_token=eBjysKrWkFHBf46qUf1Q

config/environments/development.rb

config.action_mailer.default_url_options = { protocol: 'http', host: 'localhost', port: 3000 }

So I am at a loss as to why the protocol string is not prepended. I have googled many related issues but have not turned up a relevant explanation. Any ideas what I could be doing wrong?

1
Please show us the mail viewMoustafa Sallam
do you have localhost in production environment?kalelc
include your config/environments/development.rb filekalelc
This lack of protocol at the beginning of the url might be fine. The server will redirect http to https automatically. I have tested it out and it works fine. Maybe this is devise working as it was designed?Barry

1 Answers

0
votes

It is enough just to specify the variable as follows

config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }