From ef0efe1644fa655829f2687dc41bf5e4abc1e327 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 1 Sep 2025 21:20:51 +0200 Subject: [PATCH] Fix 502 error when authenticated users directly navigate to /rezepte behind reverse proxy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove redundant locals.auth() call to prevent concurrent session verification issues. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/routes/rezepte/+page.server.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/routes/rezepte/+page.server.ts b/src/routes/rezepte/+page.server.ts index 9fdbfbb..f3b7848 100644 --- a/src/routes/rezepte/+page.server.ts +++ b/src/routes/rezepte/+page.server.ts @@ -1,22 +1,18 @@ import type { PageServerLoad } from "./$types"; import { getUserFavorites, addFavoriteStatusToRecipes } from "$lib/server/favorites"; -export async function load({ fetch, locals }) { +export async function load({ fetch, locals, parent }) { let current_month = new Date().getMonth() + 1 const res_season = await fetch(`/api/rezepte/items/in_season/` + current_month); const res_all_brief = await fetch(`/api/rezepte/items/all_brief`); const item_season = await res_season.json(); const item_all_brief = await res_all_brief.json(); - // Get user favorites and session - const [userFavorites, session] = await Promise.all([ - getUserFavorites(fetch, locals), - locals.auth() - ]); + // Get user favorites (session comes from parent layout) + const userFavorites = await getUserFavorites(fetch, locals); return { season: addFavoriteStatusToRecipes(item_season, userFavorites), - all_brief: addFavoriteStatusToRecipes(item_all_brief, userFavorites), - session + all_brief: addFavoriteStatusToRecipes(item_all_brief, userFavorites) }; };