From 41014ef6549ba231df4bb484b9357978350d0271 Mon Sep 17 00:00:00 2001 From: gunshiz Date: Tue, 6 Oct 2026 15:32:48 +0700 Subject: [PATCH] fix(site) : keep public pages up during auth outages and allow ad script --- components/public/site-header.tsx | 8 +++++++- lib/security/headers.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/public/site-header.tsx b/components/public/site-header.tsx index 5546156..a46db4e 100644 --- a/components/public/site-header.tsx +++ b/components/public/site-header.tsx @@ -8,9 +8,15 @@ import { VisitorPresence } from "@/components/public/visitor-presence"; import { PublicNavigation } from "@/components/public/public-navigation"; import { AccountMenu } from "@/components/auth/account-menu"; import { getAdminSession } from "@/lib/auth/server"; +import { HttpError } from "@/lib/security/http"; async function AdminEditLink({ editHref }: { editHref: string }) { - const isAdmin = Boolean(await getAdminSession()); + let isAdmin = false; + try { + isAdmin = Boolean(await getAdminSession()); + } catch (cause) { + if (!(cause instanceof HttpError) || cause.status !== 503) throw cause; + } return isAdmin ? (