debug(auth): add logging to Better-Auth handler for diagnosis
Temporary — will remove once auth routing is confirmed working. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -69,8 +69,11 @@ app.route("/api/calendar", calendarRouter);
|
|||||||
|
|
||||||
// Better-Auth handler — public, handles OAuth callbacks, session management
|
// Better-Auth handler — public, handles OAuth callbacks, session management
|
||||||
// Mounted BEFORE auth middleware so it's accessible without authentication
|
// Mounted BEFORE auth middleware so it's accessible without authentication
|
||||||
app.on(["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], "/api/auth/**", (c) => {
|
app.on(["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], "/api/auth/**", async (c) => {
|
||||||
return auth.handler(c.req.raw);
|
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
|
// Protected API routes
|
||||||
|
|||||||
Reference in New Issue
Block a user