fix: auto-redirect super admins to the super admin panel from root
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m45s
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m45s
- Updated AuthGuard to intercept navigation to the standard dashboard ('/') for users with the 'super_admin' role and automatically redirect them to '/super-admin'.
This commit is contained in:
5
App.tsx
5
App.tsx
@@ -76,6 +76,11 @@ const AuthGuard: React.FC<{ children: React.ReactNode, roles?: string[] }> = ({
|
||||
return <Navigate to="/" replace />;
|
||||
}
|
||||
|
||||
// Auto-redirect Super Admins away from the standard dashboard to their specific panel
|
||||
if (location.pathname === '/' && user.role === 'super_admin') {
|
||||
return <Navigate to="/super-admin" replace />;
|
||||
}
|
||||
|
||||
return <Layout>{children}</Layout>;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user