feat(login): passkey autofill (conditional mediation) on the login form#59
Merged
Conversation
Offer discoverable passkeys inline in the email/username field via WebAuthn conditional mediation, alongside the existing "Sign in with a passkey" button. - Add autocomplete="username webauthn" to the email/phone input. - Start authorizerRef.loginWithPasskeyAutofill() on mount; on success set auth data and fire onLogin. Best-effort: unsupported/cancelled ceremonies are ignored. Aborted on unmount via cancelPasskeyAutofill(). Depends on @authorizerdev/authorizer-js exposing loginWithPasskeyAutofill / cancelPasskeyAutofill (authorizer-js#43); bump the dependency before merge.
size-limit report 📦
|
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.
Draft — blocked on authorizer-js#43 release + dependency bump.
Adds WebAuthn passkey autofill to the basic-auth login form: discoverable passkeys are offered inline in the email/username field's autofill dropdown, alongside the existing "Sign in with a passkey" button. This is the smoother, no-extra-click flow used by Google/Apple.
Changes (
AuthorizerBasicAuthLogin.tsx)autocomplete="username webauthn"on the email/phone input (the attribute browsers key passkey autofill on).authorizerRef.loginWithPasskeyAutofill(); on success set auth data + fireonLogin. Best-effort and silent — unsupported/cancelled/aborted ceremonies are ignored. Aborted on unmount viacancelPasskeyAutofill().The explicit passkey button (
AuthorizerPasskeyLogin) is unchanged and remains the primary path; the SDK aborts the pending autofill request when the button's modal ceremony starts (browsers allow only one outstandingcredentials.get()).Verification
Verified
tsc --noEmitandtsupbuild pass against a locally-linked build of authorizer-js#43. CI will pass once the dependency is bumped to the released SDK version.Merge order
@authorizerdev/authorizer-jshere → CI green → merge this.