Support password reset from any verified email
What does this MR do and why?
It overrides the default behaviour of Devise
gem so that users can request forgotten password to any email they have verified.
Before this change users could request password reset email only to their primary email. After this change they can request the email to any verified email.
How to set up and validate locally
- Enable the
password_reset_any_verified_email
feature flag:Feature.enable(:password_reset_any_verified_email)
- Go to your profile email settings (eg. http://localhost:3000/-/profile/emails) and check that besides a primary email you have at least one verified and one unverified email (root user from seed complies with this criteria)
- Sign out and go to forgot your password page (eg. http://localhost:3000/users/password/new)
- Enter the primary email and check you received an email (http://localhost:3000/rails/letter_opener)
- Check the
To
email address is the same as the email you entered in the form - This worked already before this change
- Check the
- Enter one of the secondary verified emails and check you received an email
- Check the
To
email address is the same as the email you entered in the form - This is a new functionality and should not work on master
- Check the
- Enter one of the secondary unverified emails and check if you received an email. You should not receive one
Note: It might take time to see the emails delivered.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #16311 (closed)
Follow-up: #411590
Edited by Jarka Košanová