diff --git a/src/hooks/useAuth.tsx b/src/hooks/useAuth.tsx index 98b8e4f..4ffa543 100644 --- a/src/hooks/useAuth.tsx +++ b/src/hooks/useAuth.tsx @@ -35,6 +35,7 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => { try { await loginRequest(username, password) const user = await getProfile() + user.role = user.role || 0 setProfile(user) navigate("/dashboard") } catch (error: any) { diff --git a/src/routes/settings.tsx b/src/routes/settings.tsx index 59341a6..877a8fe 100644 --- a/src/routes/settings.tsx +++ b/src/routes/settings.tsx @@ -59,10 +59,7 @@ export default function SettingsPage() { const isAdmin = profile?.role === 0 - console.log(isAdmin) - if (!isAdmin) { - console.log("redirect") navigate("/dashboard/settings/waf") }