Conversation
…imary emails differ Because: - When an account's signup email differs from its current primary, the current-password check derived v1 credentials from the signup email, but the stored verifier may be salted with the primary. This blocked password change, recovery-key setup, and account deletion with "Incorrect email case". This commit: - Salts the first attempt with the primary email and falls back to the signup email on INCORRECT_EMAIL_CASE in sessionReauth, accountDestroy, and passwordChangeWithJWT; adds tests covering both salt cases. Closes FXA-14223
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
accounts.email) differs from its currentprimary email, the current-password check derived v1 credentials from the
signup email — but the stored verifier may be salted with the primary email
(e.g. after a password reset that followed a primary-email change). The
mismatch surfaced to users as an "Incorrect email case" error, blocking
Change Password, Create Recovery Key, and Delete Account with no self-serve
workaround.
This pull request
(the address the user authenticates with) and falls back to the signup email
on
INCORRECT_EMAIL_CASE, insessionReauth,accountDestroy, andpasswordChangeWithJWT(packages/fxa-auth-client/lib/client.ts). Accountswhere the two emails match are unaffected (single attempt).
accountDestroywhere the retry spread theserver error object into the email input, resolving the payload email to the
signup address instead of the primary.
packages/fxa-auth-client/test/client.tscovering theprimary→signup fallback, the single-request happy path, and non-email-case
errors not retrying.
Issue that this pull request solves
Closes: FXA-14223
Checklist
Put an
xin the boxes that applyHow to review (Optional)
sessionReauth/accountDestroy(conditional) andpasswordChangeWithJWT(candidate loop).sessionReauthfirst (shared pattern), thenpasswordChangeWithJWT, then the tests.identity email — reauth identifies the account by the primary, while the
/mfa/password/changepayload keeps the signup email so the server'semailsMatch(email, accounts.email)check still holds.Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Any other information that is important to this pull request.