completionId: cgen-7b94813453ba49768ac4bbefe87ccc76

cgen-7b94813453ba49768ac4bbefe87ccc76
This commit is contained in:
Builder.io 2025-11-13 03:42:43 +00:00
parent 067d2e0bf5
commit 1e08e6b7d8

View file

@ -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;
}