This commit is contained in:
Kenneth Jannette
2024-01-29 20:12:31 -06:00
parent 16d7b3a00d
commit e84e581d01
3 changed files with 14 additions and 29 deletions

View File

@@ -3,7 +3,9 @@ import { AuthContext } from "../Context/AuthProvider";
import { Navigate } from "react-router-dom";
const PrivateRoute = ({ children }) => {
console.log("AuthContext", AuthContext);
const { currentUserEmail } = useContext(AuthContext);
console.log("currentUserEmail", currentUserEmail);
return currentUserEmail === null ? <Navigate to="/" /> : children;
};