completionId: cgen-7b94813453ba49768ac4bbefe87ccc76
cgen-7b94813453ba49768ac4bbefe87ccc76
This commit is contained in:
parent
067d2e0bf5
commit
1e08e6b7d8
1 changed files with 9 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue