From 88118cd1578abfc43cdd2a2672d993ff11a3c234 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 2 Mar 2026 16:34:43 -0800 Subject: [PATCH] fix: use server-initiated WebAuthn flow for guardian acceptance and login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The guardian page and auth.rspace.online login page were using the client-side authenticatePasskey()/registerPasskey() SDK functions which generate their own challenge and return AuthenticationResult — but then tried to send result.challenge and result.credential (both undefined) to the server. This caused postgres to throw "UNDEFINED_VALUE" resulting in a 500 "Internal Server Error" that the client couldn't parse as JSON. Fix: use the proper server-initiated flow matching rstack-identity.ts: 1. POST /api/auth/start (or /register/start) to get server challenge 2. navigator.credentials.get/create with that challenge 3. POST /api/auth/complete (or /register/complete) with challenge + credential Co-Authored-By: Claude Opus 4.6 --- src/encryptid/server.ts | 224 ++++++++++++++++++++++++++++------------ 1 file changed, 160 insertions(+), 64 deletions(-) diff --git a/src/encryptid/server.ts b/src/encryptid/server.ts index 2c27e843..d692302f 100644 --- a/src/encryptid/server.ts +++ b/src/encryptid/server.ts @@ -1695,7 +1695,7 @@ app.get('/guardian', (c) => {