Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update frontend/src/components/ProtectedRoute.jsx
Browse files
frontend/src/components/ProtectedRoute.jsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
import React from 'react';
|
| 2 |
import { Navigate, Outlet } from 'react-router-dom';
|
| 3 |
import { useAuth } from './AuthContext';
|
| 4 |
|
|
@@ -38,7 +37,6 @@ export const ProtectedRoute = ({ requiredRole, children }) => {
|
|
| 38 |
} else {
|
| 39 |
hasPermission = role === requiredRole || role === 'super_admin' || isMasterAuth;
|
| 40 |
}
|
| 41 |
-
|
| 42 |
if (!hasPermission) {
|
| 43 |
return <Navigate to="/dashboard" replace />;
|
| 44 |
}
|
|
|
|
|
|
|
| 1 |
import { Navigate, Outlet } from 'react-router-dom';
|
| 2 |
import { useAuth } from './AuthContext';
|
| 3 |
|
|
|
|
| 37 |
} else {
|
| 38 |
hasPermission = role === requiredRole || role === 'super_admin' || isMasterAuth;
|
| 39 |
}
|
|
|
|
| 40 |
if (!hasPermission) {
|
| 41 |
return <Navigate to="/dashboard" replace />;
|
| 42 |
}
|