Skip to content

Commit 7a4e41e

Browse files
authored
Add redirect from login-form to home view for authenticated user (#71)
1 parent 5e17558 commit 7a4e41e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/vue/application/src/router.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,15 @@ const router = new Router({
7575
});
7676

7777
router.beforeEach((to, from, next) => {
78+
79+
if (to.name === "login-form" && auth.athenticated()) {
80+
next({ name: "home" });
81+
}
82+
7883
if (to.matched.some(record => record.meta.requiresAuth)) {
7984
if (!auth.athenticated()) {
8085
next({
81-
path: "/login-form",
86+
name: "login-form",
8287
query: { redirect: to.fullPath }
8388
});
8489
} else {

0 commit comments

Comments
 (0)