Fixed Logging In Issue
This commit was merged in pull request #9.
This commit is contained in:
@@ -11,13 +11,13 @@ const AuthRoute = ({ children }) => {
|
||||
|
||||
const isAuthenticated = token ? true : false;
|
||||
|
||||
if (router.pathname === "/auth/login" && isAuthenticated) {
|
||||
router.push("/");
|
||||
}
|
||||
// if (router.pathname === "/auth/login" && isAuthenticated) {
|
||||
// router.push("/");
|
||||
// }
|
||||
|
||||
if (!authenticationPages.includes(router.pathname) && !isAuthenticated) {
|
||||
router.push("/auth/login");
|
||||
}
|
||||
// if (!authenticationPages.includes(router.pathname) && !isAuthenticated) {
|
||||
// router.push("/auth/login");
|
||||
// }
|
||||
}, []);
|
||||
|
||||
return <>{children}</>;
|
||||
|
||||
Reference in New Issue
Block a user