no match routes redirect to home dashboard

This commit is contained in:
zurdi committed 2023-08-11 20:08:17 +02:00
1 parent df7c84257c
commit da84ac3349
1 file changed
+3
+3
View File
@@ -39,6 +39,7 @@ const routes = [
},
{
path: "/:pathMatch(.*)*",
name: "noMatch",
component: () => import("@/views/Dashboard.vue"),
},
],
@@ -59,6 +60,8 @@ router.beforeEach(async (to, from) => {
return { name: "login" };
} else if (isAuthenticated() && to.name === "login") {
return { name: "dashboard" };
} else if (to.name == "noMatch"){
return { name: "dashboard" };
}
});