diff --git a/app/api/theia-auth/route.ts b/app/api/theia-auth/route.ts index f36fa5d..374c2b4 100644 --- a/app/api/theia-auth/route.ts +++ b/app/api/theia-auth/route.ts @@ -29,6 +29,13 @@ const SESSION_COOKIE_NAMES = [ ]; export async function GET(request: NextRequest) { + // Debug: when called with ?debug=1, reveal which cookies were received + if (request.nextUrl.searchParams.get('debug') === '1') { + const cookieHeader = request.headers.get('cookie') ?? '(none)'; + const allNames = [...request.cookies.getAll()].map(c => c.name); + return NextResponse.json({ cookieHeader: cookieHeader.slice(0, 200), parsedNames: allNames }); + } + // Extract session token from cookies let sessionToken: string | null = null; for (const name of SESSION_COOKIE_NAMES) {