Skip to content

fix(settings): send a signed-out desktop off the v2 pairing QR page - #21432

Draft
dschom wants to merge 1 commit into
mainfrom
FXA-14657
Draft

dschom wants to merge 1 commit into
mainfrom
FXA-14657

Conversation

@dschom

@dschom dschom commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Because

  • After signing out of sync, reloading the v2 QR page on desktop still generated a pairing QR.
  • A phone that scanned that QR was approved by a desktop with no account, so its flow fell back to login.

This pull request

  • Passes the fxa_status result that AuthAndAccountSetupRoutes already fetches into the ScanQR container.
  • Waits for that status and only opens a pairing channel for a verified signed-in user.
  • Hard-navigates a signed-out, unverified, disconnected or non-answering browser to /pair.
  • Re-asks fxa_status every 5s while the QR is on screen and leaves for /pair, closing the channel, once the browser stops reporting a signed-in user.
  • Adds container tests for the pending, signed-out, unverified, disconnected and unanswered cases.

Issue that this pull request solves

Closes: FXA-14657

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-14657 — signed-out desktop on the v2 QR page

Signed in: QR on screen After a Sync sign-out: back on /pair
QR page for a signed-in browser Back on /pair after sign-out

Recording (this branch): a signed-out Firefox opens /pair/authority/scan_qr and is sent to /pair, which starts sign-in; after signing in the QR renders; a Sync sign-out while it is on screen sends the page back to /pair. Locally that lands on the connect page because the sign-out moves Firefox's channel to production; in production /pair gets a signed-out status and starts sign-in, as in the first half.

video.mp4

Other information (Optional)

The ticket asks for a redirect to fxa-root. The redirect goes to /pair rather than a bare / because /pair already owns the signed-out desktop: it begins the sync OAuth flow, lands on fxa-root with the sync params, and returns to the QR page once the browser has an account again.

Firefox sends no browser-to-page message on a sync sign-out, so the QR page polls fxa_status instead. Silence counts as signed out: signOut resets identity.fxaccounts.remote.root, so on a non-production FxA the page loses its web channel entirely.

🤖 Generated with Claude Code

Because:

- The v2 scan_qr page never read the browser's sign-in status, so after
  a sync sign-out a reload or the timeout page's retry still minted a
  channel and showed a QR.
- A phone that scanned it was approved by a desktop with no account, so
  its flow fell back to login.

This commit:

- Passes the already-fetched fxa_status result into the ScanQR container.
- Waits for the status and only opens a channel for a verified signed-in
  user, otherwise hard-navigates to /pair, which owns the signed-out desktop.
- Adds container tests for pending, signed-out, unverified, disconnected
  and unanswered browsers.

Fixes FXA-14657

This branch has not been deployed

No deployments
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