diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-09-27 18:21:37 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-09-27 18:21:37 +0200 |
| commit | 2b58ff029107b23617d8c4b246de77876b3bf053 (patch) | |
| tree | 6fc1fe6dd325e0a9d2af211bd3801dc136bc26f9 /apps/kit/src/routes/(main)/+layout.server.ts | |
| parent | f8ae7740f4a79d1374e136aba58b4c75f09b1396 (diff) | |
| download | greatoffice-2b58ff029107b23617d8c4b246de77876b3bf053.tar.xz greatoffice-2b58ff029107b23617d8c4b246de77876b3bf053.zip | |
feat: Move frontend into layout group (main)
This enables /book to load without the usual layout (app layout)
Diffstat (limited to 'apps/kit/src/routes/(main)/+layout.server.ts')
| -rw-r--r-- | apps/kit/src/routes/(main)/+layout.server.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/kit/src/routes/(main)/+layout.server.ts b/apps/kit/src/routes/(main)/+layout.server.ts new file mode 100644 index 0000000..01aae89 --- /dev/null +++ b/apps/kit/src/routes/(main)/+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 |
