changed route name to login

This commit is contained in:
2023-10-20 17:09:46 -07:00
parent b132670152
commit 07337a6cfc
11 changed files with 73 additions and 103 deletions
+6 -7
View File
@@ -1,5 +1,5 @@
"use client";
import { useEffect } from "react";
import { useEffect, useLayoutEffect } from "react";
import { useRouter } from "next/router";
/**
@@ -10,13 +10,12 @@ import { useRouter } from "next/router";
const AuthRoute = ({ children }) => {
const router = useRouter();
useEffect(() => {
const isAuthenticated = false; // In a real application, this would be determined based on the user's authentication status.
const isAuthenticated = false; // In a real application, this would be determined based on the user's authentication status.
if (!isAuthenticated) {
router.push("/auth/sign-in");
}
}, [router]);
if (!isAuthenticated) {
router.push("/");
return null;
}
return <>{children}</>;
};