From 243b1290dcc3622d79d660fe9ba61c7694cdc8f6 Mon Sep 17 00:00:00 2001 From: Emanuele Ferrelli Date: Thu, 5 Jun 2025 11:13:46 +0200 Subject: [PATCH] Bug fetch-user --- src/main.js | 8 +++++--- src/router/index.js | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main.js b/src/main.js index 41f8649..c173b0c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,9 +38,11 @@ var auth = createAuth({ router: driverRouterVueRouter }, options:{ - notFoundRedirect: '/auth/login', - authRedirect: '/auth/login', - loginData: {url: '/api/auth/login', method: 'POST', redirect: '/'}, + // notFoundRedirect: '/auth/login', + // authRedirect: '/auth/login', + authRedirect: false, // niente redirect automatici + notFoundRedirect: false, + loginData: {url: '/api/auth/login', method: 'POST', redirect: '/home'}, logoutData: {url:'/api/auth/logout', redirect: '/auth/login'}, fetchData: {url: '/api/auth/fetch-user', method: 'GET', enabled: false}, refreshData: {url: '/api/auth/refresh-token', method: 'GET', enabled: false} diff --git a/src/router/index.js b/src/router/index.js index 015b73e..4b193ce 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,6 +6,11 @@ const router = createRouter({ routes: [ { path: '/', + redirect: '/auth/login', + meta: { auth: false } + }, + { + path: '/home', component: AppLayout, meta: { auth: true @@ -17,7 +22,7 @@ const router = createRouter({ component: () => import('@/views/pages/ProjectList.vue') }, { - path: '/', + path: '/home', name: 'dashboard', component: () => import('@/views/pages/ksDocuments/KsDocuments.vue') },