From c410c1759ad72b84847f7dc611580dcf17a6c66c Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Wed, 18 Feb 2026 17:35:56 -0800 Subject: [PATCH] debug: add logging to theia-auth session lookup Co-authored-by: Cursor --- app/api/theia-auth/route.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/theia-auth/route.ts b/app/api/theia-auth/route.ts index 374c2b4..dfe1200 100644 --- a/app/api/theia-auth/route.ts +++ b/app/api/theia-auth/route.ts @@ -64,9 +64,11 @@ export async function GET(request: NextRequest) { if (result.rows.length > 0) { userEmail = result.rows[0].email; userName = result.rows[0].name; + } else { + console.log('[theia-auth] No session found for token:', sessionToken.slice(0, 8)); } - } catch { - // DB error → treat as unauthenticated + } catch (err) { + console.error('[theia-auth] DB error:', err); return redirectToLogin(request); }