Files
homepage/src/routes/[recipeLang=recipeLang]/add/+page.server.ts
Alexander Bocken 3e43b731c9
Some checks failed
CI / update (push) Failing after 2m52s
add route matcher to fix /login and /logout routes
Use SvelteKit param matcher to constrain [recipeLang] to only match
'recipes' or 'rezepte', preventing it from catching /login, /logout,
and other non-recipe routes.
2025-12-26 22:48:01 +01:00

14 lines
325 B
TypeScript

import { redirect } from "@sveltejs/kit";
export async function load({locals, params}) {
// Add is German-only - redirect to German version
if (params.recipeLang === 'recipes') {
throw redirect(301, '/rezepte/add');
}
const session = await locals.auth();
return {
user: session?.user
};
};