Rails 4 + Devise: Password Reset is always giving a “Token is invalid” error on the production server, but works fine locally.

后端 未结 5 1531
再見小時候
再見小時候 2020-12-05 04:05

I have a Rails 4 application set up to use Devise, and I\'m running a problem with password resets. I have the mailer set up, and the password reset email sends fine. The li

5条回答
  •  猫巷女王i
    2020-12-05 04:52

    It may also be worth noting (in addition to @doctororange's post ablve) the following if you are using a custom confirmation mailer view.

    The link in the view has also changed here. This is the NEW link code:

    <%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

    This is the OLD link code:

    <%= link_to 'Confirm my account', user_confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>

提交回复
热议问题