perbaikan protected route
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
// import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
// import type { LayoutServerLoad } from './$types';
|
import type { LayoutServerLoad } from './$types';
|
||||||
|
|
||||||
// export const load: LayoutServerLoad = async ({ locals }) => {
|
export const load: LayoutServerLoad = async ({ locals }) => {
|
||||||
// if (!locals.user) {
|
if (!locals.user) {
|
||||||
// throw redirect(303, '/login');
|
throw redirect(303, '/login');
|
||||||
// }
|
}
|
||||||
|
|
||||||
// return {
|
return {
|
||||||
// user: locals.user
|
user: locals.user
|
||||||
// };
|
};
|
||||||
// };
|
};
|
||||||
Reference in New Issue
Block a user