From 5afe1a0dde18f8e4f7780b3a1fb91b652f5b63a0 Mon Sep 17 00:00:00 2001 From: Nato Boram Date: Sun, 20 Oct 2024 14:09:53 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Disable=20prerendering=20for=20s?= =?UTF-8?q?erver=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/utils/cookies.ts | 4 ++-- src/routes/[site]/+layout.server.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/utils/cookies.ts b/src/lib/utils/cookies.ts index d41ee21..83d5c8d 100644 --- a/src/lib/utils/cookies.ts +++ b/src/lib/utils/cookies.ts @@ -10,8 +10,8 @@ export async function getJwt( data: { jwt: string | undefined } | null, ): Promise { if (browser) return parseCurrentHomeSite(hostname).then(hs => hs?.jwt) - else if (data) return data.jwt - else throw new Error("`getJwt` wasn't run in the browser nor in the server.") + if (data) return data.jwt + throw new Error("`getJwt` wasn't run in the browser nor in the server.") } export async function setJwt(site: Site, jwt: string) { diff --git a/src/routes/[site]/+layout.server.ts b/src/routes/[site]/+layout.server.ts index 38a3bb9..dca8851 100644 --- a/src/routes/[site]/+layout.server.ts +++ b/src/routes/[site]/+layout.server.ts @@ -4,3 +4,5 @@ export const load = (({ cookies, params }) => { const jwt = cookies.get(`${params.site}_jwt`) return { jwt } }) satisfies LayoutServerLoad + +export const prerender = false