Admin page uses roles for access check
cgen-db82ea16b8f14c648ecf2528bd47dc9c
This commit is contained in:
parent
f3581dc8d0
commit
18beba397c
1 changed files with 2 additions and 2 deletions
|
|
@ -9,9 +9,9 @@ import { Button } from "@/components/ui/button";
|
|||
import { Shield, UserCog, Rocket, Settings, Users, Activity } from "lucide-react";
|
||||
|
||||
export default function Admin() {
|
||||
const { user, loading } = useAuth();
|
||||
const { user, loading, roles } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
const isOwner = !!user?.email && user.email.toLowerCase() === "mrpiglr@gmail.com";
|
||||
const isOwner = Array.isArray(roles) && roles.includes("owner");
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue