From ebd0f671f9bfdf610fe9505eeb1386bd3c21daba Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 10 May 2026 21:50:53 +0200 Subject: [PATCH] fix(auth): mark /hilfe/transkription as public for prerender The route exports prerender = true and is listed in svelte.config.js's prerender.entries. Until now the auth hook redirected unauthenticated requests to /login, so the prerender crawler hit a 302 and the build failed with "marked as prerenderable, but were not prerendered". Adding the path to PUBLIC_PATHS lets the crawler render the static HTML; consistent with the route's intent as a public help page. Surfaced by #497 (the production Docker build is the first place npm run build runs in CI). Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/hooks.server.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/hooks.server.ts b/frontend/src/hooks.server.ts index 917ed953..39460750 100644 --- a/frontend/src/hooks.server.ts +++ b/frontend/src/hooks.server.ts @@ -5,7 +5,14 @@ import { env } from 'process'; import { cookieName, cookieMaxAge } from '$lib/paraglide/runtime'; import { detectLocale } from '$lib/shared/server/locale'; -const PUBLIC_PATHS = ['/login', '/logout', '/forgot-password', '/reset-password', '/register']; +const PUBLIC_PATHS = [ + '/login', + '/logout', + '/forgot-password', + '/reset-password', + '/register', + '/hilfe/transkription' // prerendered help page — must be reachable without an auth cookie +]; const handleLocaleDetection: Handle = ({ event, resolve }) => { if (!event.cookies.get(cookieName)) {