mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-19 05:54:07 +01:00
11 lines
356 B
JavaScript
11 lines
356 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; |