diff --git a/.env.example b/.env.example index c9dda70..04d5844 100644 --- a/.env.example +++ b/.env.example @@ -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 " -# 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 diff --git a/AGENTS.md b/AGENTS.md index c46186d..bdffc5a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,9 +6,10 @@ Scaffold is in place and verified: Turborepo monorepo with `apps/api`, `apps/web Biome as the only JS/TS tool and the text Bun lockfile committed. It is deployed with Docker Compose on Dokploy (`docker-compose.yml`); there is no hosted CI. -Not done yet: product features are just starting (sign-up, password recovery with an emailed OTP, shopping lists, list items and invitations exist; -there is no Google login and no email verification; the `voice` module splits dictated text with Groq, or Gemma 4 -through the Gemini API when Groq is not configured). The `health` module is the reference example. +Not done yet: product features are just starting (sign-up, password recovery with an emailed OTP, passkeys, +shopping lists, list items and invitations exist; there is no Google login and no email verification; the +`voice` module splits dictated text with Groq, or Gemma 4 through the Gemini API when Groq is not configured). +The `health` module is the reference example. ## Stack (source of truth: `STACK.md`) @@ -100,7 +101,8 @@ Run from the repo root. Verification order is `build`, then `lint` → `typechec `apps/web/nginx.conf`, which also proxies `/api/*` to `http://superlist-api:4100` (re-resolved through Docker's DNS, so API redeploys don't leave nginx on a stale IP). Required env vars are interpolated by Compose (`DATABASE_URL`, `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL`, `CORS_ORIGIN`, `WEB_APP_URL`); set them - in Dokploy. The dictation variables (`GROQ_API_KEY`, `GROQ_MODEL`, `GROQ_TIMEOUT_MS`, `GEMINI_API_KEY`, `GEMINI_MODEL`, + in Dokploy. `WEB_APP_URL` is not only used for email links: it is also the WebAuthn relying-party origin, so + it must be the exact public URL of the web app. The dictation variables (`GROQ_API_KEY`, `GROQ_MODEL`, `GROQ_TIMEOUT_MS`, `GEMINI_API_KEY`, `GEMINI_MODEL`, `GEMINI_TIMEOUT_MS`) are optional (Groq wins when its key is set) and backend-only — never give them a `VITE_` prefix, or Vite would ship the key in the browser bundle. There is no hosted CI. - Generated files are gitignored and must never be edited by hand: `apps/web/src/routeTree.gen.ts`, @@ -208,6 +210,15 @@ export class CreateAlert { plugin (6-digit code, 10 minutes, hashed in `verifications`): the web `/forgot-password` route calls `emailOtp.requestPasswordReset` / `emailOtp.resetPassword`, and the code is sent with `sendEmail` (`lib/mailer.ts`, template in `lib/emails/password-reset.ts`). Without `RESEND_API_KEY` the code is logged. +- **Passkeys**: the separate `@better-auth/passkey` package (installed in both apps) adds WebAuthn sign-in. + Pin it to the exact same version as `better-auth` (currently `1.7.7`): its peer dependencies + (`better-call`, `@better-auth/core`) are version-locked, so a newer passkey package breaks the API. + `lib/passkey-config.ts` derives `rpID` and `origin` from `WEB_APP_URL`, **not** from `BETTER_AUTH_URL`: + WebAuthn runs in the browser, where the web origin is `:7153` in dev and the public web domain in + production. Sign-in is username-less, so the plugin is configured with `residentKey: 'required'`. + Passkeys are bound to the domain: those registered on `localhost` do not work in production (and vice + versa). The `Passkey`/`passkeys` Prisma model is mapped by hand like the rest of the schema; the plugin + also runs `prisma migrate deploy` before starting in production. - **Prisma 7**: the generator is `prisma-client` and writes to `apps/api/src/generated/prisma` (gitignored), so import it as `@/generated/prisma/client` — never `@prisma/client` directly. The client uses the `@prisma/adapter-pg` adapter with `DATABASE_URL` and is exported as `prisma` (plus the `Database` type) from @@ -216,9 +227,10 @@ export class CreateAlert { the generated migration under `apps/api/prisma/migrations` — never edit migration files by hand. The datasource has no `url` in the schema: it comes from `prisma.config.ts` (`env('DATABASE_URL')`). For production, `apps/api` also has `db:deploy` (`prisma migrate deploy`), which is not wired to a turbo task yet. -- The BetterAuth models (`User`, `Session`, `Account`, `Verification`) are already in the schema and follow the - naming convention above (`users`, `sessions`, `accounts`, `verifications` with snake_case columns); regenerate - them with the BetterAuth CLI rather than by hand if the auth config changes, then re-apply the mapping. +- The BetterAuth models (`User`, `Session`, `Account`, `Verification`, `Passkey`) are already in the schema and + follow the naming convention above (`users`, `sessions`, `accounts`, `verifications`, `passkeys` with + snake_case columns); regenerate them with the BetterAuth CLI rather than by hand if the auth config changes, + then re-apply the mapping. `Passkey` comes from the `@better-auth/passkey` plugin, not the core CLI. ## Shared package (`@superlist/shared`) diff --git a/STACK.md b/STACK.md index 9f36daf..66e313a 100644 --- a/STACK.md +++ b/STACK.md @@ -5,4 +5,4 @@ - Rutas del frontend con TanStack Router usando file-based routing - Estado del servidor en el frontend con TanStack Query - Formularios del frontend con React Hook Form + Zod -- BetterAuth para autenticación +- BetterAuth para autenticación (email + contraseña, OTP por correo y passkeys/WebAuthn) diff --git a/apps/api/.env.example b/apps/api/.env.example index 111e21a..d580278 100644 --- a/apps/api/.env.example +++ b/apps/api/.env.example @@ -10,7 +10,9 @@ NODE_ENV="development" # RESEND_API_KEY="re_xxxxxxxx" # From address for outgoing email (must be a verified Resend sender) # MAIL_FROM="Superlist " -# 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 diff --git a/apps/api/package.json b/apps/api/package.json index 0bf45da..31c150b 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -16,6 +16,7 @@ "db:studio": "prisma studio" }, "dependencies": { + "@better-auth/passkey": "1.7.7", "@hono/zod-validator": "^0.9.1", "@prisma/adapter-pg": "^7.10.0", "@prisma/client": "^7.10.0", diff --git a/apps/api/prisma/migrations/20261029142722_add_passkeys/migration.sql b/apps/api/prisma/migrations/20261029142722_add_passkeys/migration.sql new file mode 100644 index 0000000..04d4403 --- /dev/null +++ b/apps/api/prisma/migrations/20261029142722_add_passkeys/migration.sql @@ -0,0 +1,25 @@ +-- CreateTable +CREATE TABLE "passkeys" ( + "id" TEXT NOT NULL, + "name" TEXT, + "public_key" TEXT NOT NULL, + "user_id" TEXT NOT NULL, + "credential_id" TEXT NOT NULL, + "counter" INTEGER NOT NULL, + "device_type" TEXT NOT NULL, + "backed_up" BOOLEAN NOT NULL, + "transports" TEXT, + "created_at" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP, + "aaguid" TEXT, + + CONSTRAINT "passkeys_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "passkeys_user_id_idx" ON "passkeys"("user_id"); + +-- CreateIndex +CREATE INDEX "passkeys_credential_id_idx" ON "passkeys"("credential_id"); + +-- AddForeignKey +ALTER TABLE "passkeys" ADD CONSTRAINT "passkeys_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 7057d2b..e6f2267 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -34,6 +34,7 @@ model User { updatedAt DateTime @updatedAt @map("updated_at") sessions Session[] accounts Account[] + passkeys Passkey[] ownedLists ShoppingList[] @relation("ListOwner") memberships ShoppingListMember[] invitations ShoppingListInvitation[] @relation("InvitedBy") @@ -90,6 +91,29 @@ model Verification { @@map("verifications") } +// WebAuthn credentials registered through the BetterAuth passkey plugin. +// `credentialID` is the raw credential id and `publicKey` the stored public key; +// the plugin reads and writes these rows directly, so keep the column names it +// expects (mapped to snake_case like the rest of the schema). +model Passkey { + id String @id + name String? + publicKey String @map("public_key") + userId String @map("user_id") + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + credentialID String @map("credential_id") + counter Int + deviceType String @map("device_type") + backedUp Boolean @map("backed_up") + transports String? + createdAt DateTime? @default(now()) @map("created_at") + aaguid String? + + @@index([userId]) + @@index([credentialID]) + @@map("passkeys") +} + // --- Domain models ---------------------------------------------------------- /// A collaborative shopping list. Membership (and therefore access) lives in diff --git a/apps/api/src/lib/auth.ts b/apps/api/src/lib/auth.ts index cd04d08..d28da11 100644 --- a/apps/api/src/lib/auth.ts +++ b/apps/api/src/lib/auth.ts @@ -1,3 +1,4 @@ +import { passkey } from '@better-auth/passkey' import { betterAuth } from 'better-auth' import { prismaAdapter } from 'better-auth/adapters/prisma' import { emailOTP } from 'better-auth/plugins' @@ -6,6 +7,7 @@ import { passwordResetEmail } from '@/lib/emails/password-reset' import { acceptPendingInvitations, ensurePrimaryList } from '@/lib/list-membership' import { logger } from '@/lib/logger' import { sendEmail } from '@/lib/mailer' +import { passkeyConfig } from '@/lib/passkey-config' import { prisma } from '@/lib/prisma' const trustedOrigins = (process.env.CORS_ORIGIN ?? '') @@ -57,6 +59,15 @@ export const auth = betterAuth({ }) }, }), + // Passkeys (Face ID, Touch ID, Windows Hello, security keys). Sign-in is + // username-less, so credentials must be discoverable: `residentKey` is + // required instead of the plugin's `preferred` default. + passkey({ + ...passkeyConfig, + authenticatorSelection: { + residentKey: 'required', + }, + }), ], databaseHooks: { user: { diff --git a/apps/api/src/lib/passkey-config.test.ts b/apps/api/src/lib/passkey-config.test.ts new file mode 100644 index 0000000..0b3902e --- /dev/null +++ b/apps/api/src/lib/passkey-config.test.ts @@ -0,0 +1,37 @@ +import { describe, expect, test } from 'bun:test' + +import { passkeyOrigins } from './passkey-config' + +describe('passkeyOrigins', () => { + test('keeps the development port in the origin but not in the RP ID', () => { + expect(passkeyOrigins('http://localhost:7153')).toEqual({ + origin: 'http://localhost:7153', + rpID: 'localhost', + }) + }) + + test('normalises trailing slashes and paths to a bare origin', () => { + expect(passkeyOrigins('https://superlist.app/')).toEqual({ + origin: 'https://superlist.app', + rpID: 'superlist.app', + }) + expect(passkeyOrigins('https://superlist.app/settings')).toEqual({ + origin: 'https://superlist.app', + rpID: 'superlist.app', + }) + }) + + test('uses a subdomain as the RP ID', () => { + expect(passkeyOrigins('https://app.superlist.app')).toEqual({ + origin: 'https://app.superlist.app', + rpID: 'app.superlist.app', + }) + }) + + test('falls back to localhost when the URL is invalid', () => { + expect(passkeyOrigins('not a url')).toEqual({ + origin: 'http://localhost:7153', + rpID: 'localhost', + }) + }) +}) diff --git a/apps/api/src/lib/passkey-config.ts b/apps/api/src/lib/passkey-config.ts new file mode 100644 index 0000000..26aa2d6 --- /dev/null +++ b/apps/api/src/lib/passkey-config.ts @@ -0,0 +1,30 @@ +import { webAppUrl } from '@/lib/web-app-url' + +const FALLBACK_ORIGIN = 'http://localhost:7153' + +/** + * WebAuthn ceremonies happen in the browser, so the relying party is the public + * web origin, not the API one: in development the web runs on :7153 while the + * API listens on :4100. `WEB_APP_URL` is already the canonical public URL of + * the frontend (used for invitation links), so derive both values from it. + * + * The RP ID must be a registrable suffix of the origin and cannot include the + * port; `new URL().hostname` does the right thing for both `localhost` and a + * production domain. + */ +export function passkeyOrigins(webUrl: string) { + let origin: string + + try { + origin = new URL(webUrl).origin + } catch { + origin = FALLBACK_ORIGIN + } + + return { origin, rpID: new URL(origin).hostname } +} + +export const passkeyConfig = { + ...passkeyOrigins(webAppUrl), + rpName: 'Superlist', +} diff --git a/apps/web/package.json b/apps/web/package.json index a2a6017..d2b208f 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -13,6 +13,7 @@ "test": "vitest run --passWithNoTests" }, "dependencies": { + "@better-auth/passkey": "1.7.7", "@fontsource-variable/geist": "^5.3.0", "@hookform/resolvers": "^5.9.1", "@superlist/shared": "workspace:*", diff --git a/apps/web/src/components/settings/passkeys-card.tsx b/apps/web/src/components/settings/passkeys-card.tsx new file mode 100644 index 0000000..016657f --- /dev/null +++ b/apps/web/src/components/settings/passkeys-card.tsx @@ -0,0 +1,336 @@ +import { + FingerprintIcon, + KeyRoundIcon, + MoreHorizontalIcon, + PencilIcon, + PlusIcon, + Trash2Icon, +} from 'lucide-react' +import { type FormEvent, useState } from 'react' +import { toast } from 'sonner' + +import { Badge } from '@/components/ui/badge' +import { Button } from '@/components/ui/button' +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from '@/components/ui/dialog' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from '@/components/ui/dropdown-menu' +import { Field, FieldDescription, FieldLabel } from '@/components/ui/field' +import { Input } from '@/components/ui/input' +import { Skeleton } from '@/components/ui/skeleton' +import { + type Passkey, + useAddPasskey, + useDeletePasskey, + usePasskeys, + useUpdatePasskey, +} from '@/hooks/use-passkeys' + +const DEFAULT_NAME = 'Este dispositivo' +const createdOnFormat = new Intl.DateTimeFormat('es', { dateStyle: 'medium' }) + +function passkeyLabel(passkey: Passkey) { + return passkey.name?.trim() || 'Passkey sin nombre' +} + +function passkeyDetails(passkey: Passkey) { + const created = passkey.createdAt ? new Date(passkey.createdAt) : null + + if (!created || Number.isNaN(created.getTime())) return 'Passkey de acceso' + + return `Creada el ${createdOnFormat.format(created)}` +} + +export function PasskeysCard() { + const supportsPasskeys = typeof window !== 'undefined' && 'PublicKeyCredential' in window + const passkeys = usePasskeys() + const addPasskey = useAddPasskey() + const updatePasskey = useUpdatePasskey() + const deletePasskey = useDeletePasskey() + + const [addOpen, setAddOpen] = useState(false) + const [newName, setNewName] = useState(DEFAULT_NAME) + const [renaming, setRenaming] = useState(null) + const [renameName, setRenameName] = useState('') + const [deleting, setDeleting] = useState(null) + + const openAdd = () => { + setNewName(DEFAULT_NAME) + setAddOpen(true) + } + + const openRename = (passkey: Passkey) => { + setRenameName(passkeyLabel(passkey)) + setRenaming(passkey) + } + + const onAdd = async (event: FormEvent) => { + event.preventDefault() + + try { + await addPasskey.mutateAsync(newName.trim() || DEFAULT_NAME) + setAddOpen(false) + toast.success('Passkey creada.') + } catch (error) { + toast.error(error instanceof Error ? error.message : 'No pudimos crear la passkey.') + } + } + + const onRename = async (event: FormEvent) => { + event.preventDefault() + if (!renaming) return + + try { + await updatePasskey.mutateAsync({ id: renaming.id, name: renameName.trim() || DEFAULT_NAME }) + setRenaming(null) + toast.success('Passkey renombrada.') + } catch (error) { + toast.error(error instanceof Error ? error.message : 'No pudimos renombrar la passkey.') + } + } + + const onDelete = async () => { + if (!deleting) return + + try { + await deletePasskey.mutateAsync(deleting.id) + setDeleting(null) + toast.success('Passkey eliminada.') + } catch (error) { + toast.error(error instanceof Error ? error.message : 'No pudimos eliminar la passkey.') + } + } + + return ( + + +
+
+ Passkeys + + Entra con Face ID, Touch ID o Windows Hello, sin escribir tu contraseña. + +
+ {supportsPasskeys && ( + + )} +
+
+ + {!supportsPasskeys ? ( +

+ Este navegador no admite passkeys. Prueba con uno más reciente o con la app instalada. +

+ ) : passkeys.isPending ? ( +
+ + +
+ ) : passkeys.isError ? ( +
+

+ {passkeys.error instanceof Error + ? passkeys.error.message + : 'No pudimos cargar tus passkeys.'} +

+ +
+ ) : passkeys.data.length === 0 ? ( +
+ +

Todavía no tienes passkeys

+

+ Añade una para entrar sin escribir tu contraseña. +

+
+ ) : ( +
    + {passkeys.data.map((passkey) => ( +
  • + + + + +
    +
    +

    {passkeyLabel(passkey)}

    + {passkey.backedUp && ( + + Sincronizada + + )} +
    +

    + {passkeyDetails(passkey)} +

    +
    + + + + + + + openRename(passkey)}> + + Renombrar + + setDeleting(passkey)}> + + Eliminar + + + +
  • + ))} +
+ )} +
+ + { + if (!addPasskey.isPending) setAddOpen(open) + }} + > + + + Añadir passkey + + Tu dispositivo te pedirá Face ID, Touch ID, Windows Hello o tu llave de seguridad. + + + +
+ + Nombre + setNewName(event.target.value)} + maxLength={60} + autoFocus + /> + Te ayuda a reconocerla si añades más de una. + + + + + + +
+
+
+ + { + if (!open && !updatePasskey.isPending) setRenaming(null) + }} + > + + + Renombrar passkey + + Elige un nombre que te ayude a reconocer este dispositivo o llave. + + + +
+ + Nombre + setRenameName(event.target.value)} + maxLength={60} + autoFocus + /> + + + + + + +
+
+
+ + { + if (!open && !deletePasskey.isPending) setDeleting(null) + }} + > + + + Eliminar passkey + + {deleting + ? `«${passkeyLabel(deleting)}» dejará de servir para iniciar sesión.` + : 'Esta passkey dejará de servir para iniciar sesión.'} + + + + + + + + + +
+ ) +} diff --git a/apps/web/src/hooks/use-passkeys.ts b/apps/web/src/hooks/use-passkeys.ts new file mode 100644 index 0000000..9793b86 --- /dev/null +++ b/apps/web/src/hooks/use-passkeys.ts @@ -0,0 +1,76 @@ +import { queryOptions, useMutation, useQuery, useQueryClient } from '@tanstack/react-query' + +import { authClient } from '@/lib/auth-client' + +export type Passkey = NonNullable< + Awaited>['data'] +>[number] + +const PASSKEYS_QUERY_KEY = ['passkeys'] as const + +export const passkeysQueryOptions = () => + queryOptions({ + queryKey: PASSKEYS_QUERY_KEY, + queryFn: async () => { + const { data, error } = await authClient.passkey.listUserPasskeys() + + if (error) throw new Error(error.message ?? 'No pudimos cargar tus passkeys.') + + return data ?? [] + }, + }) + +export function usePasskeys() { + return useQuery(passkeysQueryOptions()) +} + +function toError(error: { message?: string } | null, fallback: string) { + return new Error(error?.message ?? fallback) +} + +export function useAddPasskey() { + const queryClient = useQueryClient() + + return useMutation({ + mutationFn: async (name: string) => { + const { data, error } = await authClient.passkey.addPasskey({ name }) + + if (error) throw toError(error, 'No pudimos crear la passkey.') + + return data + }, + onSuccess: () => { + void queryClient.invalidateQueries({ queryKey: PASSKEYS_QUERY_KEY }) + }, + }) +} + +export function useUpdatePasskey() { + const queryClient = useQueryClient() + + return useMutation({ + mutationFn: async ({ id, name }: { id: string; name: string }) => { + const { error } = await authClient.passkey.updatePasskey({ id, name }) + + if (error) throw toError(error, 'No pudimos renombrar la passkey.') + }, + onSuccess: () => { + void queryClient.invalidateQueries({ queryKey: PASSKEYS_QUERY_KEY }) + }, + }) +} + +export function useDeletePasskey() { + const queryClient = useQueryClient() + + return useMutation({ + mutationFn: async (id: string) => { + const { error } = await authClient.passkey.deletePasskey({ id }) + + if (error) throw toError(error, 'No pudimos eliminar la passkey.') + }, + onSuccess: () => { + void queryClient.invalidateQueries({ queryKey: PASSKEYS_QUERY_KEY }) + }, + }) +} diff --git a/apps/web/src/lib/auth-client.ts b/apps/web/src/lib/auth-client.ts index 46479c9..cc95a12 100644 --- a/apps/web/src/lib/auth-client.ts +++ b/apps/web/src/lib/auth-client.ts @@ -1,3 +1,4 @@ +import { passkeyClient } from '@better-auth/passkey/client' import { emailOTPClient } from 'better-auth/client/plugins' import { createAuthClient } from 'better-auth/react' @@ -8,7 +9,7 @@ import { createAuthClient } from 'better-auth/react' */ export const authClient = createAuthClient({ baseURL: import.meta.env.VITE_API_URL || window.location.origin, - plugins: [emailOTPClient()], + plugins: [emailOTPClient(), passkeyClient()], }) export const { signIn, signUp, signOut, useSession, emailOtp } = authClient diff --git a/apps/web/src/routes/(auth)/sign-in.tsx b/apps/web/src/routes/(auth)/sign-in.tsx index c4483a5..1af8d11 100644 --- a/apps/web/src/routes/(auth)/sign-in.tsx +++ b/apps/web/src/routes/(auth)/sign-in.tsx @@ -1,6 +1,7 @@ import { zodResolver } from '@hookform/resolvers/zod' import { createFileRoute, Link, useNavigate } from '@tanstack/react-router' -import { useState } from 'react' +import { FingerprintIcon } from 'lucide-react' +import { useCallback, useEffect, useRef, useState } from 'react' import { useForm } from 'react-hook-form' import { z } from 'zod' @@ -10,7 +11,7 @@ import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Field, FieldError, FieldGroup, FieldLabel } from '@/components/ui/field' import { Input } from '@/components/ui/input' -import { signIn } from '@/lib/auth-client' +import { authClient, signIn } from '@/lib/auth-client' export const Route = createFileRoute('/(auth)/sign-in')({ validateSearch: (search: Record): { redirect?: string } => ({ @@ -26,16 +27,69 @@ const signInSchema = z.object({ type SignInValues = z.infer +const PASSKEY_ERROR_MESSAGE = 'No pudimos iniciar tu sesión con passkey.' + +/** The user dismissed the system sheet: not worth showing an error for. */ +function isPasskeyCancellation(error: unknown) { + return ( + typeof error === 'object' && + error !== null && + 'code' in error && + error.code === 'AUTH_CANCELLED' + ) +} + function SignInPage() { const navigate = useNavigate() const { redirect } = Route.useSearch() const [error, setError] = useState(null) + const [passkeyPending, setPasskeyPending] = useState(false) + const conditionalUiStarted = useRef(false) + const supportsPasskeys = typeof window !== 'undefined' && 'PublicKeyCredential' in window const form = useForm({ resolver: zodResolver(signInSchema), defaultValues: { email: '', password: '' }, }) + const completeSignIn = useCallback(async () => { + if (redirect) { + window.location.assign(redirect) + return + } + + await navigate({ to: '/' }) + }, [navigate, redirect]) + + // Conditional UI: the browser offers the user's passkeys in the email field's + // autofill. Guarded with a ref because StrictMode mounts effects twice in dev + // and a second ceremony would abort the first one. + useEffect(() => { + if (conditionalUiStarted.current || !supportsPasskeys) return + if (typeof window.PublicKeyCredential.isConditionalMediationAvailable !== 'function') return + + conditionalUiStarted.current = true + + void (async () => { + if (!(await window.PublicKeyCredential.isConditionalMediationAvailable())) return + + try { + const { error: passkeyError } = await authClient.signIn.passkey({ autoFill: true }) + + if (passkeyError) { + if (!isPasskeyCancellation(passkeyError)) { + setError(passkeyError.message ?? PASSKEY_ERROR_MESSAGE) + } + return + } + + await completeSignIn() + } catch { + setError(PASSKEY_ERROR_MESSAGE) + } + })() + }, [completeSignIn, supportsPasskeys]) + const onSubmit = form.handleSubmit(async (values) => { setError(null) @@ -46,14 +100,31 @@ function SignInPage() { return } - if (redirect) { - window.location.assign(redirect) - return - } - - await navigate({ to: '/' }) + await completeSignIn() }) + const onPasskeySignIn = async () => { + setError(null) + setPasskeyPending(true) + + try { + const { error: passkeyError } = await authClient.signIn.passkey() + + if (passkeyError) { + if (!isPasskeyCancellation(passkeyError)) { + setError(passkeyError.message ?? PASSKEY_ERROR_MESSAGE) + } + return + } + + await completeSignIn() + } catch { + setError(PASSKEY_ERROR_MESSAGE) + } finally { + setPasskeyPending(false) + } + } + return (
@@ -77,7 +148,9 @@ function SignInPage() { @@ -107,11 +180,31 @@ function SignInPage() { - + {supportsPasskeys && ( + <> +
+ + o + +
+ + + + )} +

¿Todavía no tienes cuenta?{' '} + diff --git a/bun.lock b/bun.lock index 98c4b88..e9cd4e4 100644 --- a/bun.lock +++ b/bun.lock @@ -14,6 +14,7 @@ "name": "@superlist/api", "version": "0.0.0", "dependencies": { + "@better-auth/passkey": "1.7.7", "@hono/zod-validator": "^0.9.1", "@prisma/adapter-pg": "^7.10.0", "@prisma/client": "^7.10.0", @@ -38,6 +39,7 @@ "name": "@superlist/web", "version": "0.0.0", "dependencies": { + "@better-auth/passkey": "1.7.7", "@fontsource-variable/geist": "^5.3.0", "@hookform/resolvers": "^5.9.1", "@superlist/shared": "workspace:*", @@ -292,6 +294,8 @@ "@better-auth/mongo-adapter": ["@better-auth/mongo-adapter@1.7.7", "", { "peerDependencies": { "@better-auth/core": "^1.7.7", "@better-auth/utils": "0.4.2", "mongodb": "^6.0.0 || ^7.0.0" }, "optionalPeers": ["mongodb"] }, "sha512-ZnVDuRrXqbf0oHphrEN27oTImNH5NTO26dtWatq5cXyYAsH7goof9QIoTOmxTbBxUQahKBw9T6+9h6n+RtOE+g=="], + "@better-auth/passkey": ["@better-auth/passkey@1.7.7", "", { "dependencies": { "@simplewebauthn/browser": "^13.3.0", "@simplewebauthn/server": "^13.3.1", "zod": "^4.5.4" }, "peerDependencies": { "@better-auth/core": "^1.7.7", "@better-auth/utils": "0.4.2", "@better-fetch/fetch": "1.3.2", "better-auth": "^1.7.7", "better-call": "1.4.0", "nanostores": "^1.0.1" } }, "sha512-FMhL3bspBxne8EcyPWx9LdWUCnmrNRoSxCnH9Q2FIWsSWXMYuPPcHOs07v4g0zUXmTlBSr4vwW3J6t2vdUIOlg=="], + "@better-auth/prisma-adapter": ["@better-auth/prisma-adapter@1.7.7", "", { "peerDependencies": { "@better-auth/core": "^1.7.7", "@better-auth/utils": "0.4.2", "@prisma/client": "^5.0.0 || ^6.0.0 || ^7.0.0", "prisma": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "optionalPeers": ["@prisma/client", "prisma"] }, "sha512-4YcnrcVdvWiAZw0sZl63tWUClPXg5r3QsLn7C2sG7kKEBY06zOng0ibecyxRBixKq1zE1ceHuEUqez5Rhi+nQA=="], "@better-auth/telemetry": ["@better-auth/telemetry@1.7.7", "", { "peerDependencies": { "@better-auth/core": "^1.7.7", "@better-auth/utils": "0.4.2", "@better-fetch/fetch": "1.3.2" } }, "sha512-PaRA6i+kAioVYmza2gHPcdrxP0hAotph4KV9hft2GeNJq+AZXDiBu3FuLM9HxvcmiZeUT74Vufqd9ypmB8veTA=="], @@ -340,6 +344,8 @@ "@fontsource-variable/geist": ["@fontsource-variable/geist@5.3.0", "", {}, "sha512-j0m+vLQuG5XAYoHtGCVu0spvlGreR3EzpECUVzkFmI1mTVnAO38l/NEPDCFgZ177JxzYJCLSmTQibIiYPilGrA=="], + "@hexagon/base64": ["@hexagon/base64@1.1.28", "", {}, "sha512-lhqDEAvWixy3bZ+UOYbPwUbBkwBq5C1LAJ/xPC8Oi+lL54oyakv/npbA0aU2hgCsx/1NUd4IBvV03+aUBWxerw=="], + "@hono/node-server": ["@hono/node-server@1.19.9", "", { "peerDependencies": { "hono": "^4" } }, "sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw=="], "@hono/zod-validator": ["@hono/zod-validator@0.9.1", "", { "peerDependencies": { "hono": ">=4.11.2", "zod": "^3.25.0 || ^4.0.0" } }, "sha512-iiv6w0qrIc0arfvCtUqBWsvl4fXjzaTcQcCJTTtCnkawF9HHGE+KjEl0ox3gQJ6rKZEgE3mLExlQCF72M+mNuw=="], @@ -366,6 +372,8 @@ "@kobalte/utils": ["@kobalte/utils@0.9.2", "", { "dependencies": { "@solid-primitives/event-listener": "^2.2.14", "@solid-primitives/keyed": "^1.2.0", "@solid-primitives/map": "^0.4.7", "@solid-primitives/media": "^2.2.4", "@solid-primitives/props": "^3.1.8", "@solid-primitives/refs": "^1.0.5", "@solid-primitives/utils": "^6.2.1" }, "peerDependencies": { "solid-js": "^1.8.8" } }, "sha512-jRVXr+zsVHxzDXRoh+CDeXzvCsFJ6uiHhqqNQ26Cw9ZsZ3D6nqPUBt1gGVtj2ZPmRL3a9Uk1v8D1aJ8/I12Dow=="], + "@levischuck/tiny-cbor": ["@levischuck/tiny-cbor@0.2.11", "", {}, "sha512-llBRm4dT4Z89aRsm6u2oEZ8tfwL/2l6BwpZ7JcyieouniDECM5AqNgr/y08zalEIvW3RSK4upYyybDcmjXqAow=="], + "@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.32.1", "", { "dependencies": { "@hono/node-server": "^1.19.9 || ^2.0.5", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-2DdE+SJDtzLEEWzY1ZjY7Q+VcPhcV1KisD3zI4u0XZyktsjHum1mwbMI+JaulUBi2OZk+KJAi2uPXzxichPkdw=="], "@napi-rs/lzma-linux-x64-gnu": ["@napi-rs/lzma-linux-x64-gnu@1.5.1", "", { "os": "linux", "cpu": "x64" }, "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ=="], @@ -384,6 +392,32 @@ "@oxc-project/types": ["@oxc-project/types@0.153.0", "", {}, "sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw=="], + "@peculiar/asn1-android": ["@peculiar/asn1-android@2.11.1", "", { "dependencies": { "@peculiar/asn1-schema": "^2.11.1", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-AuUBRDNdWrgtnuJGXARa0Xdtq6OAD8GqezDQz6Qka7kyynMo9fzkcrtpBEHuX984uEB570BrhMZfJfkUDfpQfw=="], + + "@peculiar/asn1-cms": ["@peculiar/asn1-cms@2.11.1", "", { "dependencies": { "@peculiar/asn1-schema": "^2.11.1", "@peculiar/asn1-x509": "^2.11.1", "@peculiar/asn1-x509-attr": "^2.11.1", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-Bk+oatE62dW0Tzzpfk6vdQxfGGEfvuGdWgmijnKjcv7HqZCJISs85z4zw2uDArrk+R1Oel1wts/BBl7HHrtAcA=="], + + "@peculiar/asn1-csr": ["@peculiar/asn1-csr@2.11.1", "", { "dependencies": { "@peculiar/asn1-schema": "^2.11.1", "@peculiar/asn1-x509": "^2.11.1", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-KVfbXaKng8886/tOPG55t5K1XkTkGbR4amjIJzytXWobFU5nZgw/sKnSpa1hxP17nUSsrOF/7Mt9WUYeyLsi6Q=="], + + "@peculiar/asn1-ecc": ["@peculiar/asn1-ecc@2.11.1", "", { "dependencies": { "@peculiar/asn1-schema": "^2.11.1", "@peculiar/asn1-x509": "^2.11.1", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-7MSNji77fQa/oN3WAfwagMy8EoJFg50sW4hZ1dtr0zU1BSugit0I2DGpIdPhvkNplopQhz5bogxpn1077eaamA=="], + + "@peculiar/asn1-pfx": ["@peculiar/asn1-pfx@2.11.1", "", { "dependencies": { "@peculiar/asn1-cms": "^2.11.1", "@peculiar/asn1-pkcs8": "^2.11.1", "@peculiar/asn1-rsa": "^2.11.1", "@peculiar/asn1-schema": "^2.11.1", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-2SN2z8qkc2hk/GgTYA8RN54wtsCDZShg9gI2Mq1vLhdj1adcv5fhTbiEmExZUaAMqlizxiEpULQDfHM5iYtn1g=="], + + "@peculiar/asn1-pkcs8": ["@peculiar/asn1-pkcs8@2.11.1", "", { "dependencies": { "@peculiar/asn1-schema": "^2.11.1", "@peculiar/asn1-x509": "^2.11.1", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-HqsSrnpQghRp9SM9QSmR6fa4z/BNktnKq7928+oq4qF0VAnuHZ4cyePKvcxh9fP4taBCP/WHNItlVNsYaQm2qw=="], + + "@peculiar/asn1-pkcs9": ["@peculiar/asn1-pkcs9@2.11.1", "", { "dependencies": { "@peculiar/asn1-cms": "^2.11.1", "@peculiar/asn1-pfx": "^2.11.1", "@peculiar/asn1-pkcs8": "^2.11.1", "@peculiar/asn1-schema": "^2.11.1", "@peculiar/asn1-x509": "^2.11.1", "@peculiar/asn1-x509-attr": "^2.11.1", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-OHFkTg8D2zYafILqFE4KPbqX8srpvd3diGDc2h2cduumawc765mOHGcuFMGvLWlL2bbCMWMmMSCtlXptsOuiPA=="], + + "@peculiar/asn1-rsa": ["@peculiar/asn1-rsa@2.11.1", "", { "dependencies": { "@peculiar/asn1-schema": "^2.11.1", "@peculiar/asn1-x509": "^2.11.1", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-6KwKGjulF489CpidZqkogNgLj6oGzgC4BL2FClM8PuJQ4t5NqT4q4a6A4vrSxBIBhMnL8hGYkLOpbVw0Vq38Tw=="], + + "@peculiar/asn1-schema": ["@peculiar/asn1-schema@2.11.1", "", { "dependencies": { "@peculiar/utils": "^2.0.2", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-jaU9OaCcbZUdyXx9hMETZB9xoNmxTGjOGFqd3cOwKFkpKnyKd9WxF3uqj4PvX4cyOMP9bSdHg5YyML2qtx/d/g=="], + + "@peculiar/asn1-x509": ["@peculiar/asn1-x509@2.11.1", "", { "dependencies": { "@peculiar/asn1-schema": "^2.11.1", "@peculiar/utils": "^2.0.2", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-SXU4/X6B3FquqQAN6ARI0bFDUV7+L1WlvPEPMKzEMkstd2D7UyM0r93fv241+OjdhqAKYGx5MvV3gzZMAp0APA=="], + + "@peculiar/asn1-x509-attr": ["@peculiar/asn1-x509-attr@2.11.1", "", { "dependencies": { "@peculiar/asn1-schema": "^2.11.1", "@peculiar/asn1-x509": "^2.11.1", "asn1js": "^3.0.10", "tslib": "^2.8.1" } }, "sha512-n7RKFrbTzt8pGBlZ90kmKEn1qsLTTyw7lrvHMK0xsA42kQugPk/GXYpNbEcl7DkkdVsU/one5UX7KQPfxLj8vQ=="], + + "@peculiar/utils": ["@peculiar/utils@2.0.3", "", { "dependencies": { "tslib": "^2.8.1" } }, "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ=="], + + "@peculiar/x509": ["@peculiar/x509@1.14.3", "", { "dependencies": { "@peculiar/asn1-cms": "^2.6.0", "@peculiar/asn1-csr": "^2.6.0", "@peculiar/asn1-ecc": "^2.6.0", "@peculiar/asn1-pkcs9": "^2.6.0", "@peculiar/asn1-rsa": "^2.6.0", "@peculiar/asn1-schema": "^2.6.0", "@peculiar/asn1-x509": "^2.6.0", "pvtsutils": "^1.3.6", "reflect-metadata": "^0.2.2", "tslib": "^2.8.1", "tsyringe": "^4.10.0" } }, "sha512-C2Xj8FZ0uHWeCXXqX5B4/gVFQmtSkiuOolzAgutjTfseNOHT3pUjljDZsTSxXFGgio54bCzVFqmEOUrIVk8RDA=="], + "@pinojs/redact": ["@pinojs/redact@0.4.0", "", {}, "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg=="], "@prisma/adapter-pg": ["@prisma/adapter-pg@7.10.0", "", { "dependencies": { "@prisma/driver-adapter-utils": "7.10.0", "@types/pg": "^8.16.0", "pg": "^8.16.3", "postgres-array": "3.0.4" } }, "sha512-N7nwSor0HO1Kz6xBv0TPAjAPysKK0fac6p4fVN3ensLOuzc/83Fgmln5k92eK/cvzqdkSR/2kkAqlbcdwVrwpw=="], @@ -632,6 +666,10 @@ "@shadcn/registry": ["@shadcn/registry@0.1.3", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/parser": "^7.28.0", "@babel/plugin-transform-typescript": "^7.28.0", "@babel/preset-typescript": "^7.27.1", "@dotenvx/dotenvx": "^1.48.4", "cn": "^0.2.4", "code-block-writer": "^13.0.3", "deepmerge": "^4.3.1", "execa": "^9.6.0", "fast-glob": "^3.3.3", "fs-extra": "^11.3.1", "fuzzysort": "^3.1.0", "kleur": "^4.1.5", "ora": "^8.2.0", "postcss": "^8.5.23", "prompts": "^2.4.2", "recast": "^0.23.11", "socks": "^2.8.8", "stringify-object": "^5.0.0", "tsconfig-paths": "^4.2.0", "type-fest": "^4.41.0", "undici": "^7.29.0", "zod": "^3.24.1" } }, "sha512-82/OmKAVM9pChDHFVAsDP9PcimPGSKZGdbcdwdGGGcSI69ImpN4ZnqsfZ4hkOFEMal92t3y9djYJHMjO4PcVZA=="], + "@simplewebauthn/browser": ["@simplewebauthn/browser@13.3.0", "", {}, "sha512-BE/UWv6FOToAdVk0EokzkqQQDOWtNydYlY6+OrmiZ5SCNmb41VehttboTetUM3T/fr6EAFYVXjz4My2wg230rQ=="], + + "@simplewebauthn/server": ["@simplewebauthn/server@13.3.3", "", { "dependencies": { "@hexagon/base64": "^1.1.27", "@levischuck/tiny-cbor": "^0.2.2", "@peculiar/asn1-android": "^2.6.0", "@peculiar/asn1-ecc": "^2.6.1", "@peculiar/asn1-rsa": "^2.6.1", "@peculiar/asn1-schema": "^2.6.0", "@peculiar/asn1-x509": "^2.6.1", "@peculiar/x509": "^1.14.3" } }, "sha512-LelX/lcy5cjc15A86i/aNxHhB5eU7dd20QsbP0VLAf9e38+SLlsnqCCyecx3xqfGofhmX05h1J9fKRYWxw+luA=="], + "@sindresorhus/merge-streams": ["@sindresorhus/merge-streams@4.0.0", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="], "@solid-primitives/event-listener": ["@solid-primitives/event-listener@2.4.6", "", { "dependencies": { "@solid-primitives/utils": "^6.4.1" }, "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-5I0YJcTVYIWoMmgBSROBZGcz+ymhew/pGTg2dHW74BUjFKsV8Li4bOZYl0YAGP4mHw5o4UBd9/BEesqBci3wxw=="], @@ -854,6 +892,8 @@ "arraybuffer.prototype.slice": ["arraybuffer.prototype.slice@1.0.4", "", { "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "is-array-buffer": "^3.0.4" } }, "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ=="], + "asn1js": ["asn1js@3.1.0", "", { "dependencies": { "pvtsutils": "^1.3.6", "pvutils": "^1.2.0", "tslib": "^2.8.1" } }, "sha512-HWYi1THkOqguCiO+vwj09ZkQFD2kKEsejYHAYCtX0D80WVdoDnvRc9IukXX/jeb0T9NRWJnRtqwdbHltnFjwXA=="], + "assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="], "ast-types": ["ast-types@0.16.3", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-FvWoWYfSCM6kRxCSH+MGLHIKKGRL6A6AW7Zek2O32REPQRdg131428uRTKMBYAeRd3XXAaHDS60Wpri7CdKDrA=="], @@ -1596,6 +1636,10 @@ "pure-rand": ["pure-rand@6.1.0", "", {}, "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA=="], + "pvtsutils": ["pvtsutils@1.3.6", "", { "dependencies": { "tslib": "^2.8.1" } }, "sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg=="], + + "pvutils": ["pvutils@1.2.0", "", {}, "sha512-BbubeCEyTuQjVMakvJQ/Sxbc93F2pwmbsxONT/ZRrwU7Ua38d8unYTwXpTVLAKJ4BDuH9IGztCjQcd/N/39Dvg=="], + "qs": ["qs@6.16.0", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA=="], "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], @@ -1638,6 +1682,8 @@ "redux-thunk": ["redux-thunk@3.1.0", "", { "peerDependencies": { "redux": "^5.0.0" } }, "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw=="], + "reflect-metadata": ["reflect-metadata@0.2.2", "", {}, "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q=="], + "reflect.getprototypeof": ["reflect.getprototypeof@1.0.10", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.9", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.7", "get-proto": "^1.0.1", "which-builtin-type": "^1.2.1" } }, "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw=="], "regenerate": ["regenerate@1.5.0", "", {}, "sha512-1s+CxXjJ71i7LNVy8nYwg47XV4y6lAnOEhsMtSKq3WpmPfhl9LuKlTqKIn/3yUpE8lBz+W+TT88Bxyhnr0U4yw=="], @@ -1844,6 +1890,8 @@ "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + "tsyringe": ["tsyringe@4.10.0", "", { "dependencies": { "tslib": "^1.9.3" } }, "sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw=="], + "turbo": ["turbo@2.11.7", "", { "optionalDependencies": { "@turbo/darwin-64": "2.11.7", "@turbo/darwin-arm64": "2.11.7", "@turbo/linux-64": "2.11.7", "@turbo/linux-arm64": "2.11.7", "@turbo/windows-64": "2.11.7", "@turbo/windows-arm64": "2.11.7" }, "bin": { "turbo": "bin/turbo" } }, "sha512-RhXHbqfvY6o3xt/zSHCwSNwLrZlXiqHzewi4eAj9PtZ1T1CqgMJ2yIDb7SKPTG9IikTm925mfzL6hldQVdyNWw=="], "tw-animate-css": ["tw-animate-css@1.4.0", "", {}, "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ=="], @@ -2118,6 +2166,8 @@ "terser/commander": ["commander@2.20.3", "", {}, "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="], + "tsyringe/tslib": ["tslib@1.14.1", "", {}, "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="], + "type-is/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], "workbox-build/fs-extra": ["fs-extra@9.1.0", "", { "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ=="],