Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: when changing email with email based 2FA enabled, fail fast #19831

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

netroms
Copy link
Contributor

@netroms netroms commented Jan 31, 2025

Summary

When a user has enabled email based 2FA, and the user tries to change their email address, throw an exception.
The user must be forced to disable their 2FA, before they can change their email address.
If this is not enforced, the consequence will be that the user no longer has a verified email, since the 2FA code only will be sent to a verified email address, the user will not be able to log in.

Automatic tests

  • TwoFactorControllerTest

Manual test steps:

  1. Enable email 2FA on a user
  2. Try to change the user's email via /me endpoint
  3. Observe you get an error
  4. Try to change the user's email via /user endpoint, as admin
  5. Observe you get an error

Copy link

sonarqubecloud bot commented Feb 2, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants