completed middleware
This commit is contained in:
@@ -10,12 +10,13 @@ import { useRouter } from "next/router";
|
||||
const AuthRoute = ({ children }) => {
|
||||
const router = useRouter();
|
||||
|
||||
const isAuthenticated = false; // In a real application, this would be determined based on the user's authentication status.
|
||||
useEffect(() => {
|
||||
const isAuthenticated = false; // In a real application, this would be determined based on the user's authentication status.
|
||||
|
||||
if (!isAuthenticated) {
|
||||
router.push("/");
|
||||
return null;
|
||||
}
|
||||
if (!isAuthenticated) {
|
||||
router.push("/");
|
||||
}
|
||||
}, []);
|
||||
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user