Commit 64f36a55 authored by TokaKaram's avatar TokaKaram

rebuild frontend

parent e1b61ea7
This diff is collapsed.
......@@ -5,7 +5,7 @@ import Loading from '../Common/Loading';
export default function ProtectedRoute({ children, adminOnly = false }) {
const { user, loading } = useAuth();
if (loading) return <Loading />;
if (!user) return <Navigate to="/login" />;
if (adminOnly && user.role !== 'admin') return <Navigate to="/" />;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment