penambahan route protection

This commit is contained in:
aji@catalis.app
2025-06-13 19:36:53 +07:00
parent 9668e3ace3
commit 7be6168330
8 changed files with 365 additions and 223 deletions

View File

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