completionId: cgen-441826299bbd4c78937f0a8d4515b0ff
cgen-441826299bbd4c78937f0a8d4515b0ff
This commit is contained in:
parent
dbceb1f522
commit
0e0849cb25
1 changed files with 2 additions and 2 deletions
|
|
@ -26,14 +26,14 @@ export default function StaffAdmin() {
|
|||
|
||||
useEffect(() => {
|
||||
if (!loading && !user) {
|
||||
navigate("/staff/login");
|
||||
navigate("/admin");
|
||||
return;
|
||||
}
|
||||
const isAdmin = roles?.some((r) =>
|
||||
["owner", "admin", "founder"].includes(r.toLowerCase()),
|
||||
);
|
||||
if (!isAdmin) {
|
||||
navigate("/staff/dashboard");
|
||||
navigate("/admin");
|
||||
}
|
||||
}, [user, roles, loading, navigate]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue