From cc4833e831c650d6746723eb6e9f692375bce2ed Mon Sep 17 00:00:00 2001 From: "groombook-ci[bot]" Date: Sat, 28 Mar 2026 14:59:33 +0000 Subject: [PATCH] debug(auth): add logging to Better-Auth handler for diagnosis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Temporary — will remove once auth routing is confirmed working. Co-Authored-By: Claude Opus 4.6 --- apps/api/src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts index 2e9a4ff..7efab9e 100644 --- a/apps/api/src/index.ts +++ b/apps/api/src/index.ts @@ -69,8 +69,11 @@ app.route("/api/calendar", calendarRouter); // Better-Auth handler — public, handles OAuth callbacks, session management // Mounted BEFORE auth middleware so it's accessible without authentication -app.on(["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], "/api/auth/**", (c) => { - return auth.handler(c.req.raw); +app.on(["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], "/api/auth/**", async (c) => { + console.log("[better-auth] handler called:", c.req.method, c.req.path, c.req.url); + const response = await auth.handler(c.req.raw); + console.log("[better-auth] response:", response.status); + return response; }); // Protected API routes