Conversation
…TP setup Because: - A passkey or passwordless+passkey session is session-AAL2, so AAL2 RPs (e.g. AMO) are satisfied at the OAuth grant. Those RPs require account-level 2FA (TOTP), which a passkey does not provide, so with no TOTP the grant keeps succeeding while the RP keeps rejecting, looping the user on the cached-signin screen. This commit: - Removes the isPasskeySession gate on the inline-TOTP-setup divert so it fires for any session satisfying session-AAL2 without account 2FA (fresh passkey ceremony or cached passkey session). - SigninCached forwards accountHasTotp from the cached-signin response (totpIsActive) so the divert runs on the cached path. - Adds a unit case for the cached (non-ceremony) divert plus functional tests for the cached passkey AAL2 session with and without TOTP.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an OAuth AAL2 relier (e.g., AMO) “cached sign-in loop” for passkey-based sessions by ensuring users without account-level 2FA (TOTP) are diverted to inline TOTP enrollment even when the session is reused (cached) and not the result of a fresh passkey ceremony.
Changes:
- Removes the
isPasskeySessiongating so the inline-TOTP-setup divert triggers for any OAuth-web integration that wants 2FA whenaccountHasTotp === false. - Plumbs
totpIsActivethrough the cached-signin response and forwards it asaccountHasTotpintohandleNavigation. - Adds/updates unit + functional tests covering the cached-passkey-session divert behavior (and the “already has TOTP” non-divert case).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/fxa-settings/src/pages/Signin/utils.ts | Broadens the inline TOTP setup divert condition by removing the passkey-session-only gate. |
| packages/fxa-settings/src/pages/Signin/utils.test.ts | Adds a unit test ensuring cached passkey sessions without TOTP still divert to inline TOTP setup. |
| packages/fxa-settings/src/pages/Signin/mocks.tsx | Updates cached-signin mock response to include totpIsActive. |
| packages/fxa-settings/src/pages/Signin/interfaces.ts | Extends CachedSigninHandlerResponse to include totpIsActive in data. |
| packages/fxa-settings/src/pages/Signin/components/SigninCached/index.tsx | Forwards data.totpIsActive as accountHasTotp into navigation handling. |
| packages/functional-tests/tests/passkeyAuth/passkey-signin.spec.ts | Adds functional coverage for cached passkey sessions (with/without TOTP) against AMO-style profile AAL2 behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vpomerleau
approved these changes
Jun 3, 2026
Contributor
vpomerleau
left a comment
There was a problem hiding this comment.
Thanks for this, the fix makes sense. Appreciate the added tests! ![]()
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
This pull request
isPasskeySessiongate on the inline-TOTP-setup divert inutils.ts, so it fires for any session satisfying session-AAL2 without account 2FA (fresh passkey ceremony or cached passkey session); the divert stays gated onwantsTwoStepAuthentication()+accountHasTotp === false.SigninCached/index.tsxto forwardaccountHasTotp: data.totpIsActive(already returned by the cached-signin handler, no new network call).totpIsActivetoCachedSigninHandlerResponse(interfaces.ts) and the mock (mocks.tsx).Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-13883
Checklist
Other information
How to test (local, passkeys enabled):
/inline_totp_setup(not a cached-signin loop). With TOTP enrolled, sign-in completes with no divert.