This commit is contained in:
Kenneth Jannette
2024-01-31 20:31:03 -06:00
parent 56ee3c2d65
commit b7625d6c95
9 changed files with 11 additions and 17 deletions

View File

@@ -3,9 +3,8 @@ 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;
};