From 28cd9dd776f1c98549727b8c0a627d40d5de5b78 Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Wed, 18 Feb 2026 16:53:32 -0800 Subject: [PATCH] fix: correct snake_case column names in session lookup SQL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prisma maps sessionToken → session_token and userId → user_id in the PostgreSQL sessions table. The forwardAuth query was using the wrong camelCase column names. Co-authored-by: Cursor --- app/api/theia-auth/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/theia-auth/route.ts b/app/api/theia-auth/route.ts index e938965..f36fa5d 100644 --- a/app/api/theia-auth/route.ts +++ b/app/api/theia-auth/route.ts @@ -48,8 +48,8 @@ export async function GET(request: NextRequest) { const result = await query<{ email: string; name: string }>( `SELECT u.email, u.name FROM sessions s - JOIN users u ON u.id = s."userId" - WHERE s."sessionToken" = $1 + JOIN users u ON u.id = s.user_id + WHERE s.session_token = $1 AND s.expires > NOW() LIMIT 1`, [sessionToken],