From 8a75bde33b4cdfcc5959fefc7d2aabc8ea6cc086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albin=20M=C3=A9doc?= Date: Tue, 3 Dec 2024 14:16:41 +0100 Subject: [PATCH] Add error logging for header authentication --- src/routes/login/+page.server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/routes/login/+page.server.ts b/src/routes/login/+page.server.ts index f4c8f22..bb8c493 100644 --- a/src/routes/login/+page.server.ts +++ b/src/routes/login/+page.server.ts @@ -36,11 +36,13 @@ export const load: PageServerLoad = async ({ locals, request, cookies }) => { if (!user) { if (!env.HEADER_EMAIL || !env.HEADER_NAME) { + console.error("Missing required environment variables for header authentication"); return fail(400, { username: username, password: "", incorrect: true }); } const name = request.headers.get(env.HEADER_NAME); const email = request.headers.get(env.HEADER_EMAIL); if (!name || !email) { + console.error("Missing required headers for header authentication"); return fail(400, { username: username, password: "", incorrect: true }); } const userCount = await client.user.count();