aboutsummaryrefslogtreecommitdiffstats
path: root/apps/kit/src/routes/+layout.server.ts
blob: 01aae89a2c741e3a9100cee16904c62433290a51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
// import {is_active} from "$lib/session";
// import {redirect} from "@sveltejs/kit";
// import type {LayoutServerLoad} from "./$types";
//
// export const load: LayoutServerLoad = async ({routeId}) => {
//     const sessionIsValid = await is_active();
//     const isPublicRoute = routeId?.startsWith("(public)");
//     if (sessionIsValid && isPublicRoute) {
//         throw redirect(302, "/home");
//     } else if (!sessionIsValid && !isPublicRoute) {
//         throw redirect(302, "/login");
//     }
// };