redirect users with token #38

This commit is contained in:
weeman 2021-09-24 17:51:37 +02:00
parent c1d78fa8c1
commit 2d700c77dc
Signed by untrusted user: weeman
GPG Key ID: 34F0524D4DA694A1
1 changed files with 6 additions and 1 deletions

View File

@ -46,7 +46,12 @@ const routes = [
{
path: '/',
name: 'Index',
component: Index
component: Index,
beforeEnter: (_to, _from, next) => {
if (store.state.token) {
next({name: 'Search'})
}
}
},
]