Could you assist me in resolving this issue?
router.js
routes: [{
path: "",
component: () => import("@/layouts/full-page/FullPage.vue"),
children: [{
path: "/pages/login",
name: "page-login",
component: () => import("@/views/pages/Login.vue")
}, {
path: "/pages/signup",
name: "page-signup",
component: () => import("@/views/pages/Signup.vue")
}, {
path: "/pages/error-404",
name: "page-error-404",
component: () => import("@/views/pages/Error404.vue")
}]
}, {
path: "*",
redirect: "/pages/error-404"
}]
Furthermore, the following code snippet is causing the error:
router.beforeEach((to, from, next) => {
if (to.path != "/pages/login") {
if (auth.isAuthenticated()) {
next();
} else {
if(to.path == "/pages/signup") {
next("/pages/signup");
}else{
next("/pages/login");
}
}
} else {
next();
}
});
An error occurs consistently when opening pages/signup, with the console displaying the message:
"RangeError: Maximum call stack size exceeded"