问题
If a user is already logged in and clicks on a password reset link from their email, they automatically get redirected to the logged in area. I want the user to be able to reset their password, logged in or not. How do I prevent the redirect?
回答1:
What you are trying to do is, use Devise recoverable
module to change a logged in user password. This is not what recoverable
module was built for.
As per carlosantoniodasilva
, a Collaborator of Devise
This feature is for recovering passwords, not for signed in users change their passwords. If you want that, you can use Registerable module or handle it by yourself.
Registerable
module handles signing up users through a registration process, also allowing them to edit and destroy their account.
来源:https://stackoverflow.com/questions/23207785/devise-dont-redirect-on-password-reset-if-already-logged-in