aboutsummaryrefslogblamecommitdiffstats
path: root/panel/src/components/PrivateRoute.jsx
blob: 04e00f76b10224d76ab8394c78a651c614569b8e (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                             
import React from 'react';
import { Navigate, Outlet } from 'react-router-dom';
import { useAuth } from '../contexts/AuthContext';

const PrivateRoute = () => {
  const { currentUser } = useAuth();
  return currentUser ? <Outlet /> : <Navigate to="/login" />;
};

export default PrivateRoute;