mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-20 06:24:07 +01:00
12 lines
357 B
JavaScript
12 lines
357 B
JavaScript
import React from "react";
|
|
import { Navigate, Outlet } from "react-router-dom";
|
|
import { useAuth } from "./hooks/authentication/IsAuthenticated";
|
|
|
|
const PrivateRoute = () => {
|
|
const { isAuthenticated, setIsAuthenticated } = useAuth();
|
|
const auth = isAuthenticated;
|
|
return auth ? <Outlet /> : <Navigate to="/login" />;
|
|
};
|
|
|
|
export default PrivateRoute;
|