feat(passkey): expose wrap state on the password reset flow - #21155
Draft
vpomerleau wants to merge 1 commit into
Draft
feat(passkey): expose wrap state on the password reset flow#21155vpomerleau wants to merge 1 commit into
vpomerleau wants to merge 1 commit into
Conversation
Because: - A Sync account whose passkey can recover its encryption keys should get the passkey wording on the reset footer, which was suppressed for every Sync sign-in while wraps did not exist. - Wrap state describes account state, so it belongs on the email-verified step of the reset flow and on no unauthenticated route. - Wraps can be stored before sign-in can unwrap them, so the footer needs the same kill switch the wrap routes use. This commit: - Adds hasPasskeyWraps to PasskeyService, backed by a per-uid wrap count. - Returns hasPasskeyWraps from /password/forgot/verify_otp and adds it to the auth-client return type. - Threads the signals through the reset flow as one grouped object. - Gates the passkey reset footer on a wrap plus passkeyPasswordlessSyncEnabled for Sync, failing closed when either is unknown. - Asserts the flag is absent from /account/status and never looked up there. Closes #FXA-14220
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
passkey wording on the reset footer; it was suppressed for every Sync sign-in
while wraps did not exist.
the reset flow and on no unauthenticated route.
This pull request
hasPasskeyWrapstoPasskeyService, backed by a per-uid wrap count.hasPasskeyWrapsfrom/password/forgot/verify_otpand adds it to theauth-client return type.
passkeyPasswordlessSyncEnabledfor Sync, failing closed when either is unknown.
/account/statusand never looked up there.Issue that this pull request solves
Closes: FXA-14220
Checklist
Put an
xin the boxes that applyHow to review (Optional)
lib/routes/password.tsfor the new lookup and itsgating, and
lib/passkeys/should-show-passkey-reset-option.tsfor the footer decision.passkey.wrap.repository.ts→passkey.service.ts→routes/password.ts→should-show-passkey-reset-option.ts→ the reset-flow containers.hasPasskeyWrapsmust stay off/account/status;account.spec.tsasserts both the handler omission and theJoi schema rejection.
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
PasskeyServicemethod this ticket assumed had not landed, so therepository → manager → service chain is added here. Another in-flight wrap change
needs a per-credential lookup in the same files and will collide textually.
passkeyPasswordlessSyncEnabled, beyond the ticket'sacceptance criteria. Wrap storage can ship ahead of wrap consumption, and without
the gate the footer would send a user mid-reset to a passkey sign-in that asks for
the password they just declared forgotten.