redirect login home page

This commit is contained in:
2025-06-13 09:10:13 +08:00
parent ee2be6d778
commit 25232f2c84
4 changed files with 96 additions and 397 deletions

View File

@@ -0,0 +1,12 @@
import { redirect } from '@sveltejs/kit';
import type { LayoutServerLoad } from './$types';
export const load: LayoutServerLoad = async ({ locals }) => {
if (!locals.user) {
throw redirect(303, '/login');
}
return {
user: locals.user
};
};

View File

@@ -0,0 +1,8 @@
import { redirect } from "@sveltejs/kit";
export const load = async (event) => {
if (!event.locals.user){
console.log(event.url)
}
}