From aeb787b4a425977091aca8dc494eea1f11d96a63 Mon Sep 17 00:00:00 2001 From: Emanuele Ferrelli Date: Thu, 5 Jun 2025 10:52:56 +0200 Subject: [PATCH] Bug fetch-user login --- src/main.js | 8 +++++--- src/router/index.js | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index 8793216..25da123 100644 --- a/src/main.js +++ b/src/main.js @@ -41,9 +41,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 9960772..9238ba7 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -7,6 +7,11 @@ const router = createRouter({ routes: [ { path: '/', + redirect: '/auth/login', + meta: { auth: false } + }, + { + path: '/home', component: AppLayout, meta: { auth: true