Skip to content

feat(login): passkey autofill (conditional mediation) on the login form#59

Merged
lakhansamani merged 3 commits into
mainfrom
feat/passkey-autofill
Jul 12, 2026
Merged

feat(login): passkey autofill (conditional mediation) on the login form#59
lakhansamani merged 3 commits into
mainfrom
feat/passkey-autofill

Conversation

@lakhansamani

Copy link
Copy Markdown
Contributor

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).
  • On mount, start authorizerRef.loginWithPasskeyAutofill(); on success set auth data + fire onLogin. Best-effort and silent — unsupported/cancelled/aborted ceremonies are ignored. Aborted on unmount via cancelPasskeyAutofill().

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 outstanding credentials.get()).

Verification

Verified tsc --noEmit and tsup build 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

  1. Merge + release authorizer-js#43.
  2. Bump @authorizerdev/authorizer-js here → CI green → merge this.

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.
@lakhansamani lakhansamani marked this pull request as ready for review July 12, 2026 09:57
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/index.cjs 55.93 KB (+0.62% 🔺)
dist/index.mjs 55.64 KB (+0.86% 🔺)

@lakhansamani lakhansamani merged commit 9f6f511 into main Jul 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant