fix(security): resolve all critical, high, and medium security vulnerabilities
This commit is contained in:
1 parent
da26dd1c8d
commit
dc88677169
33 files changed
+438
-85
No files matched your search
@@ -69,7 +69,15 @@ export default function ProtectedRoute() {
|
||||
);
|
||||
}
|
||||
|
||||
if (!useAdminAuthStore.getState().isAuthenticated) {
|
||||
const user = useAdminAuthStore.getState().adminUser;
|
||||
const isUserAuthenticated = useAdminAuthStore.getState().isAuthenticated;
|
||||
|
||||
if (!isUserAuthenticated || !user) {
|
||||
return <Navigate to="/login" replace />;
|
||||
}
|
||||
|
||||
const role = (user.role || '').toUpperCase();
|
||||
if (role !== 'ADMIN' && role !== 'SUPER_ADMIN') {
|
||||
return <Navigate to="/login" replace />;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user