Oliver Walker
Oliver Walker

Reputation: 25

Devise password reset link not working with https

I'm building a rails application and I just noticed the reset link is not working. When I send an email to reset the password I get the following url sent to me:

https://shopperbot.com/users/password/edit?reset_password_token=###

This does not even reach my website. it is probably a problem with how i am forwarding the domain shopperbot to my heroku domain. I played around with the link and it works when I either take out the s in https or add www. before shopperbot. I rather make the change in the link than fix the issue of it not reaching my site. How do I make either of those changes to the link?

In other words, how do I make the link look like either of these options:

http://shopperbot.com/users/password/edit?reset_password_token=###

https://www.shopperbot.com/users/password/edit?reset_password_token=###

instead of what it currently is: https://shopperbot.com/users/password/edit?reset_password_token=###

Upvotes: 1

Views: 964

Answers (1)

spickermann
spickermann

Reputation: 106892

Just adjust your mailer configuration to something like this:

config.action_mailer.default_url_options = { 
  host: 'www.shopperbot.com', 
  protocol: 'https'
}

Upvotes: 4

Related Questions