aboutsummaryrefslogtreecommitdiff
path: root/web/ui/src/routes/dashboard/+layout.server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'web/ui/src/routes/dashboard/+layout.server.ts')
-rw-r--r--web/ui/src/routes/dashboard/+layout.server.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/web/ui/src/routes/dashboard/+layout.server.ts b/web/ui/src/routes/dashboard/+layout.server.ts
new file mode 100644
index 0000000..8eebc76
--- /dev/null
+++ b/web/ui/src/routes/dashboard/+layout.server.ts
@@ -0,0 +1,12 @@
+import { redirect } from '@sveltejs/kit';
+
+import type { LayoutServerLoad } from './$types';
+
+export const load: LayoutServerLoad = async ({ locals }) => {
+ if (!locals.account) {
+ throw redirect(303, '/');
+ }
+ return {
+ account: locals.account
+ };
+};