From 56bb2e6b1b6b4eea89f3b1cd5beb53d18243f620 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 21 Jul 2026 20:23:26 +0000 Subject: [PATCH] Add a redirect for bare /admin to /admin/settings Only /admin/login and /admin/settings existed as actual pages, so navigating to /admin itself 404'd regardless of ADMIN_PANEL_ENABLED. Settings already redirects to login on a 401, so that's the sensible default landing spot. --- frontend/src/routes/admin/+page.svelte | 1 + frontend/src/routes/admin/+page.ts | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 frontend/src/routes/admin/+page.svelte create mode 100644 frontend/src/routes/admin/+page.ts diff --git a/frontend/src/routes/admin/+page.svelte b/frontend/src/routes/admin/+page.svelte new file mode 100644 index 0000000..6996c2f --- /dev/null +++ b/frontend/src/routes/admin/+page.svelte @@ -0,0 +1 @@ + diff --git a/frontend/src/routes/admin/+page.ts b/frontend/src/routes/admin/+page.ts new file mode 100644 index 0000000..7323d50 --- /dev/null +++ b/frontend/src/routes/admin/+page.ts @@ -0,0 +1,9 @@ +import { redirect } from '@sveltejs/kit'; +import type { PageLoad } from './$types'; + +// There's no page at exactly /admin — only /admin/login and /admin/settings — so a +// bare visit here would otherwise 404. Settings itself already redirects to login on +// a 401, so sending everyone through there is the one sensible default landing spot. +export const load: PageLoad = async () => { + throw redirect(302, '/admin/settings'); +};