aboutsummaryrefslogtreecommitdiffstats
path: root/apps/kit/src/routes/+layout.server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/kit/src/routes/+layout.server.ts')
-rw-r--r--apps/kit/src/routes/+layout.server.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/kit/src/routes/+layout.server.ts b/apps/kit/src/routes/+layout.server.ts
new file mode 100644
index 0000000..01aae89
--- /dev/null
+++ b/apps/kit/src/routes/+layout.server.ts
@@ -0,0 +1,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");
+// }
+// }; \ No newline at end of file