- Added login check for navbar actions

This commit is contained in:
Alexis
2020-07-06 18:24:54 +02:00
parent 78587f8544
commit 27ab62e36f
6 changed files with 19 additions and 11 deletions

View File

@@ -69,10 +69,10 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.authGuard)) {
if (Vue.$cookies.get('loggedUser') == null) {
if (Vue.$cookies.get('U_') == null) {
next({
path: '/connexion',
params: { nextUrl: to.fullPath }
params: { nextUrl: to.fullPath },
})
} else {
next()