more
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user