Skip to content

fix(settings): When enabled, ask for 2FA before approving a v2 pairing flow - #21431

Merged
dschom merged 1 commit into
mainfrom
FXA-14643-ui
Oct 8, 2026
Merged

dschom merged 1 commit into
mainfrom
FXA-14643-ui

Conversation

@dschom

@dschom dschom commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Because

  • The v2 pairing flow approved a sign-in from the desktop without asking a 2FA account for its TOTP code, unlike v1.

This pull request

  • Adds /pair/authority/totp, reusing the v1 AuthTotp page, and sends 2FA accounts there before the approval screen.
  • Re-prompts for the code if the approval screen has been open longer than four minutes.
  • Shares the TOTP-required check between v1 AuthAllow and the v2 container.
  • Rejects a web channel command promptly when Firefox replies with an error for it.
  • Registers the route in both content-server lists and adds a v2 functional test.

Issue that this pull request solves

Closes: FXA-14643

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.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

FXA-14643 — v2 pairing asks a 2FA account for its code before approving

After (this branch): TOTP prompt After (this branch): approve screen
After: authority asked for its TOTP code After: approve sign-in, device box redacted

Recording, after (this branch), authority side only:

video-redacted.mp4

Other information (Optional)

Any other information that is important to this pull request.

…pairing

Because:
- The v2 pairing flow approved a sign-in from the desktop without asking a
  2FA account for its TOTP code, unlike v1.

This commit:
- Adds /pair/authority/totp, reusing the v1 AuthTotp page, and sends 2FA accounts there before the approval screen.
- Re-prompts for the code if the approval screen has been open longer than four minutes.
- Shares the TOTP-required check between v1 AuthAllow and the v2 container.
- Rejects a web channel command promptly when Firefox replies with an error for it.
- Registers the route in both content-server lists and adds a v2 functional test.

Fixes FXA-14643
@dschom
dschom requested a review from a team as a code owner October 8, 2026 21:44
FXA_STATUS_TIMEOUT_MS
);
).catch((err) => {
console.warn('[Firefox WebChannel] fxa_status failed', err);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a dumb question; can/should this go to sentry? Feels kind of important if that message fails

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shows up as bread crumbs

Comment thread packages/fxa-settings/src/lib/pairing/totp-gate.ts
@dschom
dschom merged commit 7c8da60 into main Oct 8, 2026
19 of 21 checks passed
@dschom
dschom deleted the FXA-14643-ui branch October 8, 2026 23:34
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