From 1e08e6b7d8b9aa7a9b67a6cb73a900ed36ed9408 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Thu, 13 Nov 2025 03:42:43 +0000 Subject: [PATCH] completionId: cgen-7b94813453ba49768ac4bbefe87ccc76 cgen-7b94813453ba49768ac4bbefe87ccc76 --- client/pages/StaffDashboard.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/pages/StaffDashboard.tsx b/client/pages/StaffDashboard.tsx index 4818adb1..f287d1b7 100644 --- a/client/pages/StaffDashboard.tsx +++ b/client/pages/StaffDashboard.tsx @@ -34,10 +34,17 @@ export default function StaffDashboard() { const [activeTab, setActiveTab] = useState("overview"); useEffect(() => { - // Check if user is @aethex.dev + // Check if user is @aethex.dev (primary or linked email) if (!loading && user) { const email = user.email || profile?.email || ""; - if (!email.endsWith("@aethex.dev")) { + const hasDevEmail = + email.endsWith("@aethex.dev") || + (profile as any)?.is_dev_account || + user.identities?.some((identity: any) => + identity.identity_data?.email?.endsWith("@aethex.dev"), + ); + + if (!hasDevEmail) { navigate("/staff/login", { replace: true }); return; }