fix(fxa-settings): route passkey Sync sign-in to password fallback on mobile#20739
Draft
vpomerleau wants to merge 1 commit into
Draft
fix(fxa-settings): route passkey Sync sign-in to password fallback on mobile#20739vpomerleau wants to merge 1 commit into
vpomerleau wants to merge 1 commit into
Conversation
… mobile Because: - On mobile Firefox, signing in to Sync via a passkey left the browser in a "syncing paused" state with no redirect to the password fallback. Mobile commonly omits the service=sync URL param (defaulting to Sync via clientId), so getService() returned undefined and the server never set requiresPasswordForSync. This commit: - Sends service=sync for Sync integrations using isSync() — the signal already trusted for the can-link check — instead of the often-absent service URL param, so the password fallback redirect fires for both standard and passwordless accounts. - Skips navigation on mobile in the passkey password fallback so Firefox drives Sync completion via WebChannel messages rather than navigating the WebView away. Closes #FXA-13911
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a mobile Firefox Sync passkey sign-in regression where the flow could silently skip the required password fallback (leaving Sync “paused”) when service=sync was omitted from the URL. It makes the passkey completion call reliably identify Sync sign-ins and prevents WebView navigation on Firefox mobile so Sync completion can be driven via WebChannel.
Changes:
- Force
service: 'sync'whenintegration.isSync()is true (even ifintegration.getService()is undefined), ensuring the server setsrequiresPasswordForSync. - Pass
performNavigation: !integration.isFirefoxMobileClient()tohandleNavigationin the passkey fallback password step to avoid navigating away on mobile Firefox. - Add regression tests for missing
serviceparam handling and desktop vs mobile navigation behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/fxa-settings/src/pages/Signin/SigninPasskeyFallback/container.tsx | Disables navigation on Firefox mobile during passkey password fallback completion. |
| packages/fxa-settings/src/pages/Signin/SigninPasskeyFallback/container.test.tsx | Adds tests asserting performNavigation is true on desktop and false on mobile. |
| packages/fxa-settings/src/lib/passkeys/signin-flow.ts | Derives service as 'sync' when integration.isSync() to trigger Sync password fallback reliably. |
| packages/fxa-settings/src/lib/passkeys/signin-flow.test.tsx | Adds test verifying completePasskeyAuthentication receives { service: 'sync' } when getService() is absent. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
via a passkey did nothing — the browser was left in a "syncing paused" state
with no redirect to the password fallback. This affected both standard
(password) and passwordless accounts.
service=syncURL param and infers Sync fromthe client ID, so
getService()returnedundefined, the server never setrequiresPasswordForSync, and the password step required to derive Sync keyswas silently skipped.
This pull request
integration.isSync() ? 'sync' : integration.getService()in
packages/fxa-settings/src/lib/passkeys/signin-flow.ts, so Sync sign-insreliably trigger the password fallback redirect (
/signin_passkey_fallbackforstandard accounts,
/post_verify/set_passwordfor passwordless).isSync()isthe same signal already trusted for the can-link check.
performNavigation: !integration.isFirefoxMobileClient()inpackages/fxa-settings/src/pages/Signin/SigninPasskeyFallback/container.tsxsomobile lets Firefox complete Sync via WebChannel messages instead of navigating
the WebView away — matching the existing idiom in
SigninTokenCode,SigninTotpCode,SigninRecoveryCode, andSigninRecoveryPhone.service=syncwhen the URL param is absent, andmobile vs desktop navigation behaviour in the fallback container.
Issue that this pull request solves
Closes: FXA-13911
Checklist
Put an
xin the boxes that applyHow to review (Optional)
STR:
Expectation:
Bug:
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
Pre-merge review completed:
/fxa-reviewreturned APPROVE (0 blocking issues) and/fxa-security-reviewfound no security concerns. Client-side change infxa-settings; validation via Playwright Sync passkey functional tests.