fix(site) : keep public pages up during auth outages and allow ad script
CI / Verify (push) Successful in 1m33s
CI / Build immutable images and deploy (push) Successful in 1m39s

This commit is contained in:
2026-10-06 15:32:48 +07:00 Unverified
parent 5ebe4db78c
commit 41014ef654
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -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 ? (
<Button variant="ghost" size="sm" nativeButton={false} render={<Link href={editHref} />} aria-label="ไปหน้าแก้ไข">