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:
@@ -0,0 +1 @@
|
||||
<!-- Never actually renders — +page.ts's load always redirects to /admin/settings before this displays. -->
|
||||
@@ -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');
|
||||
};
|
||||
Reference in New Issue
Block a user