From 732363abfd3611c98b93cf2c6ace5c81d5f365f3 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Sat, 28 Mar 2026 18:17:18 +0100 Subject: [PATCH] Add secrets configuration to wrangler.jsonc and improve null checks in layout component --- apps/dashboard/src/routes/+layout.svelte | 2 +- apps/dashboard/wrangler.jsonc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/routes/+layout.svelte b/apps/dashboard/src/routes/+layout.svelte index 66adbebe..8912381f 100644 --- a/apps/dashboard/src/routes/+layout.svelte +++ b/apps/dashboard/src/routes/+layout.svelte @@ -101,7 +101,7 @@ $effect(() => { // this means the session cookie 'classroomio.session_data' expired and we need to trigger a new session // triggering a new session will update the session data in the cookies so that our hooks.server.ts doesn't always have to hit the DB when checking if user is logged in or not. Without the session cookie, every page navigation or route would always hit the database to check if user is logged in or not. - if (!data.locals.fromSessions && isSessionReady) { + if (!data?.locals?.fromSessions && isSessionReady) { authClient.getSession().then(() => { console.log('triggered new session'); }); diff --git a/apps/dashboard/wrangler.jsonc b/apps/dashboard/wrangler.jsonc index 2fceec22..6fceb658 100644 --- a/apps/dashboard/wrangler.jsonc +++ b/apps/dashboard/wrangler.jsonc @@ -12,5 +12,8 @@ "enabled": true, "invocation_logs": true } + }, + "secrets": { + "required": ["PRIVATE_SERVER_KEY"] } }