Skip to content

Commit

Permalink
Add error logging for header authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
albinmedoc authored Dec 3, 2024
1 parent f6bdcbb commit 8a75bde
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/routes/login/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8a75bde

Please sign in to comment.