feat(passkeys): implement sign-in ceremony on Index and Signin pages#20575
Draft
vpomerleau wants to merge 4 commits into
Draft
feat(passkeys): implement sign-in ceremony on Index and Signin pages#20575vpomerleau wants to merge 4 commits into
vpomerleau wants to merge 4 commits into
Conversation
…apper Because: - The Mozilla design system replaces the circular third-party auth buttons with a unified box-style layout. - Index/Signin/Signup need structural groundwork (composition, visibility gating, error banner slot) before FXA-13099 wires the passkey ceremony. This commit: - Adds `BoxButton`, a reusable presentational primitive. - Adds `AlternativeAuthOptions`, composing divider + optional passkey button + `ThirdPartyAuth` row + inline error banner. Driven by `showThirdPartyAuth`, `showPasskeySignin`, and `isStandalone` props. - Adds a `'box'` variant to `ThirdPartyAuth`; refactors `ButtonPasskeySignin` to wrap `BoxButton`. - Wires the wrapper into Index, Signin, and Signup. Moves the `thirdPartyAuth.loginNoPwView` Glean event to Signin and restores it to a reachable state for the linked-no-password case. Closes: FXA-13487
Because: * The implementation matched an outdated design This commit: * Update the error messsage, and include a support link in the error component * Show the updated message in an alert bar, not inline Closes #FXA-13683
…ng state
Because:
- The "Cancel" button on the "Creating passkey…" loading page navigated back
to settings without any feedback. When a credential manager popup (e.g.,
Bitwarden) is dismissed via focus loss, the WebAuthn ceremony stays pending
and Cancel is the user's only escape — but it returned silently, leaving
no confirmation that cancellation was processed.
This commit:
- Shows the standard cancellation banner ("Passkey setup was canceled. Try
again.") in the alert bar before navigating back, mirroring the feedback
the user gets when the ceremony itself reports a cancel/timeout.
Closes #FXA-13681
Because: We need to wire the passkey WebAuthn ceremony to the passkey button introduced in FXA-13487. This commit: * Adds a usePasskeySignIn hook driving the ceremony, error handling, Sync merge gate, and post-auth routing, and wires it into the Index and Signin pages. * Mounts /signin/passkey/fallback as a temporary stand-in until FXA-13100 lands the real password-fallback page. * Fixes the auth-server passkey route to return sessionToken.data instead of .id so the client can Hawk-sign subsequent requests. * Enables passkeyAuthenticationEnabled in local.json-dist. * Adds functional tests covering the passkey sign-in happy, cancel, and PASSKEY_NOT_FOUND paths. Closes #FXA-13099
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
usePasskeySignInhook owning the WebAuthn ceremony, error categorisation, Sync merge gate, account persistence, and post-auth routing. Validates theaccountProfileresponse before relying onemail, and sanitises Sentry captures so server-error responses cannot leak PII.authClientandfinishOAuthFlowHandlerthrough the Index container./signin/passkey/fallbackas a temporary stand-in for FXA-13100; hides the passkey button on Sync entry-points behind the same TODO.PASSKEY_NOT_FOUND(errno 224); does not report to Sentry since it is an expected divergence between server and authenticator state.sessionToken.datainstead of.idso the client can Hawk-sign subsequent requests.passkeyAuthenticationEnabledinlocal.json-dist(dev only; production flag stays off via the convict default).PASSKEY_NOT_FOUNDpaths.Issue that this pull request solves
Closes: FXA-13099
Checklist
Put an
xin the boxes that applyHow to review
packages/fxa-settings/src/lib/passkeys/signin-flow.ts(the hook),packages/fxa-settings/src/pages/{Index,Signin}/(wiring),packages/fxa-auth-server/lib/routes/passkeys.ts(sessionToken fix),packages/functional-tests/tests/passkeyAuth/passkey-signin.spec.ts(new tests).Other information
email.*/login.*events plus password-page events) and will instrument both pages once this lands.!integration.isSync(). FXA-13100 will replace the temporarySetPasswordContainermount at/signin/passkey/fallbackwith a container that derives Sync keys viaverifyPasswordAfterPasskey; the Sync button can re-enable then.sessionToken.id → .datachange inpasskeys.tsis a real bug latent in main since5a17be0bb7— every passkey sign-in via the existing route would have failed downstream Hawk-authenticated calls. Worth filing a separate bug to track for backport visibility.