Devise: Don't redirect on password reset if already logged in

半城伤御伤魂 提交于 2019-12-25 02:52:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!