check token before redirect

This commit is contained in:
Jonathan Baecker 2020-04-29 10:30:35 +02:00
parent 3fdfa20f05
commit 94ca13ad95

View File

@ -1,4 +1,6 @@
export default function ({ store, redirect }) {
export default async function ({ store, redirect }) {
await store.dispatch('auth/inspectToken')
if (!store.state.auth.isLogin) {
return redirect('/')
}