diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 3564ddb..e0fd6d1 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -5,10 +5,8 @@ import LoginView from '../views/LoginView.vue' import userAPIS from '../api/user' const authGuard = async () => { - console.log('1tady') const data = await userAPIS.getUserStatus() if (!data.data) { - console.log('tady') throw router.push('/') } } @@ -59,7 +57,9 @@ router.beforeEach(async (to, from, next) => { if (requiresAuth) { const userStatus = await userAPIS.getUserStatus() if (!userStatus.data) { - throw router.push('/login') + router.replace('/login') + next() + return } }