Repository navigation
Conversation
Adds SaRegisterAuthenticator, SaAuthenticatorCode and SaAuthenticatorAppSettings over the shared client flows. The sign-in fallbacks offer an authenticator app, and passkey enrollment offers one when the device cannot register a passkey and always to a recovery session, which can no longer skip. Refs #216
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.
Closes #216. Stacked on #218 (shared client pieces); merge that first.
Summary
Authenticator app (TOTP) screens for the Svelte binding.
authRoutePathsadds two new screens:SaRegisterAuthenticator(/register-authenticator) shows a QR code fromqrCode(), the setup key with a copy button, and anotpauth://link (only for anotpauth://URL). It verifies the first code, ends on a success state, then continues whereSaRegisterPasskeydoes. "Back" keepsreturnTo.SaAuthenticatorCode(/authenticator-code) signs in withsignInWithTotp. It explains a wrong or reused code, a lockout and a rate limit.SaFallbackOptionsgains an optionalonAuthenticatorApp.SaLoginpasses it, so the option appears whenever a pre-auth sign-in falls back.SaRegisterPasskey:SaAuthenticatorAppSettings. It shows status, sets up an app with Cancel, and turns it off with a current code.TotpStatus.Step-up prompts are out of scope here. The Svelte binding prompts for step-up nowhere yet.
Tests
16 new vitest cases:
returnTo, a refused code, copy failure and backsecret_requiredthen retry, and no link for a non-otpauthURLrecoverySessionfalse, and one without passkeysChecks
lint, typecheck (svelte-check), format:check, build (with
finalize-svelte-dist) and test (jest 784 passed, vitest 56 passed) all pass.