Skip to content

WIP - Fix keystretch upgrade failure#20533

Open
dschom wants to merge 1 commit into
mainfrom
FXA-13627
Open

WIP - Fix keystretch upgrade failure#20533
dschom wants to merge 1 commit into
mainfrom
FXA-13627

Conversation

@dschom
Copy link
Copy Markdown
Contributor

@dschom dschom commented May 6, 2026

Because

  • We were getting a strong signal in Sentry that some accounts were experiencing v1->v2 key stretching upgrade failures.

This pull request

  • Makes the process more reliable by fetching the original account email before starting the key-stretching upgrade process.
  • This is simpler and less error prone than starting the upgrade process, waiting for an incorrectPassword to provide the correct email to use as a salt, and then having to try again.

Issue that this pull request solves

Closes: FXA-13627

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

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.

@dschom dschom force-pushed the FXA-13627 branch 3 times, most recently from 8fca746 to 9ef88dd Compare May 7, 2026 23:01
@dschom dschom changed the title wip WIP - Fix keystretch upgrade failure May 14, 2026
@dschom dschom marked this pull request as ready for review May 15, 2026 23:17
@dschom dschom requested a review from a team as a code owner May 15, 2026 23:17
…s and session reauths

Because:
- v1 password stretching salts using the account's original signup
  email, which can differ from the user's current primary. Clients that
  used the typed/current primary computed the wrong authPW on the first
  try, forcing email-case retry logic and brittle lookahead in the
  password-change and reauth flows.

This commit:
- Adds GET /session/original-account-email returning the account's
  signup email for the authenticated session, with swagger docs.
- Adds AuthClient.fetchOriginalAccountEmail and uses it in
  sessionReauth, passwordChange, and passwordChangeWithAuthPW so v1
  derivations match the stored verifier on the first attempt.
- Threads originalLoginEmail through SessionReauthOptions so callers
  that already fetched the email (e.g. passwordChangeWithAuthPW) avoid
  a redundant round-trip.
- Updates auth-server route, password.ts, and remote tests to the new
  flow; renames the sessionReauth parameter email -> primaryEmail to
  disambiguate from the derivation email.
- Replaces a Sentry.captureMessage with captureException(err, { tags })
  on the v2-upgrade failure path so stacks are preserved.
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.

1 participant