Skip to content

Conversation

@vbudhram
Copy link
Contributor

@vbudhram vbudhram commented Jan 15, 2026

Because

  • Users refreshing the confirmation code page during Firefox Sync OAuth flow saw "Bad Request" error
  • In-memory OAuth keys (keyFetchToken, unwrapBKey) are lost on page refresh with no recovery path

This pull request

  • Adds useOAuthFlowRecovery hook to recover from interrupted OAuth Native flows via Firefox webchannel
  • Adds fxaOAuthFlowBegin and fxaOAuthFlowIsActive commands to firefox.ts
  • Updates SigninTokenCode and ConfirmSignupCode to attempt recovery when state is missing
  • Redirects to /signin with fresh OAuth params on successful recovery

Issue

Closes: https://mozilla-hub.atlassian.net/browse/FXA-12118

Checklist

  • My commit is GPG signed
  • Tests pass locally (if applicable)
  • Documentation updated (if applicable)
  • RTL rendering verified (if UI changed)

Other Information

How to test:

  1. Open Firefox → Settings → Sync → Sign in
  2. Enter credentials, reach confirmation code page
  3. Refresh the page (F5)
  4. Should redirect to /signin instead of "Bad Request" error

Note: Requires Firefox with fxaccounts:oauth_flow_begin webchannel support

YOu can download it here: https://drive.google.com/file/d/1oKZHHJXqJ5C0LniU-iJwxnLoCQE1FvWt/view?usp=drive_link

@vbudhram vbudhram self-assigned this Jan 15, 2026
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