Encountering a recurring issue of maximum stack size exceeded while implementing the following code for vue router navigation guards per-route:
import state from "../vuex-store/state.js";
import Editor from "../views/Editor";
const routes = [
{
path: "/editor",
component: Editor,
beforeEnter: (to, from, next) => {
if (state.isAuthorized) {
if (from.path === "/editor") {
next(false);
} else {
next("/editor");
}
} else {
next(false);
}
}
}
];
Seeking clarification on the cause of this recursion error and potential solutions. Any insights would be greatly appreciated. Thank you!