Rails / Devise - forced password reset

I implemented the ability to automatically generate user passwords using Devise. Now that the user is logged in, I would like to force the user to reset the password. Devise doesn't seem to have that kind of functionality (please correct me if I'm wrong). I can come up with several ways to achieve this, but I'm sure there is a standard way to do this.

Any advice would be appreciated.

Thanks.

+4
source share
1 answer

Devise processes the password controller with the appropriate views to change the user password. In the application controller, you can override some development methods such as after_sign_up_path, after_sign_in_path, after_confirmation_path, etc. Using new_password_route, which, as I recall, is a router helper for changing the password, but not sure. I will think that you are sending mail with the generated password and a confirmation link. If not, then what you do is useless. Password generation, so the user must change that this is not true with respect to UX. Just ask the user with the desire to go at the beginning.

Good luck.

0
source

Source: https://habr.com/ru/post/1437348/


All Articles