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.
This commit is contained in:
Claude
2026-07-21 20:23:26 +00:00
parent fd12f11cd7
commit 56bb2e6b1b
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
<!-- Never actually renders — +page.ts's load always redirects to /admin/settings before this displays. -->
+9
View File
@@ -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');
};