diff --git a/functions/_middleware.ts b/functions/_middleware.ts index 6866b65..fcb3fd3 100644 --- a/functions/_middleware.ts +++ b/functions/_middleware.ts @@ -126,7 +126,7 @@ async function setTheme(context: RequestContext) { ); const theme = themeCookie?.split("=").at(1); - if (!theme) context.data.theme = "dark"; + if (!theme || !["dark", "light"].includes(theme)) context.data.theme = "dark"; else context.data.theme = theme; return await context.next();