feat(auth): add passkey sign-in and management

Sign in with Face ID, Touch ID, Windows Hello or a security key, keeping
email + password as the primary method.

- API: BetterAuth passkey plugin deriving rpID/origin from WEB_APP_URL
  (the browser origin), with residentKey "required" because sign-in is
  username-less. New Passkey model mapped to the passkeys table.
- Web: conditional UI in the email field plus an explicit "Entrar con
  passkey" button; cancelled ceremonies are ignored.
- Settings: create, rename and delete passkeys with TanStack Query.
- Pin @better-auth/passkey to 1.7.7: its peers lock better-call, so
  newer versions break the API.
This commit is contained in:
Jose Selesan
2026-10-29 11:37:38 -03:00
parent f3d9996b11
commit 7ed4d27844
17 changed files with 724 additions and 21 deletions

View File

@@ -17,7 +17,9 @@ NODE_ENV="development"
# RESEND_API_KEY="re_xxxxxxxx"
# From address for outgoing email (must be a verified Resend sender)
# MAIL_FROM="Superlist <invitaciones@superlist.app>"
# Public URL of the web app, used to build the accept-invitation links
# Public URL of the web app. Used to build invitation links and as the WebAuthn
# relying-party origin for passkeys (no trailing slash), so it must be the exact
# public origin users open in the browser.
WEB_APP_URL="http://localhost:7153"
# Dictation: AI Studio (Gemini API) key, backend only. NEVER prefix it with VITE_
# or Vite would put it in the browser bundle. Without it, dictated text is split