From 5577628c56942e17abca7c2ed08b4067593093f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa?= Date: Wed, 27 Aug 2025 10:55:25 +0200 Subject: [PATCH] fix logout action --- components/NavBar.vue | 8 +++----- components/NavBarEditar.vue | 13 ++++++++++--- components/NavBarEditarUser.vue | 14 +++++++++++--- components/NavMenu.vue | 11 ++++++----- layouts/admin.vue | 22 +++++++++++++++++----- stores/auth.ts | 23 ++++++++++++----------- 6 files changed, 59 insertions(+), 32 deletions(-) diff --git a/components/NavBar.vue b/components/NavBar.vue index 473dd3c..daca11c 100644 --- a/components/NavBar.vue +++ b/components/NavBar.vue @@ -2,7 +2,7 @@
@@ -71,7 +71,6 @@ import { mapActions } from 'pinia' import { useAuthStore } from '@/stores/auth' export default { - setup() { const auth = useAuthStore(); return { @@ -89,10 +88,9 @@ export default { return this.auth.getName }, }, - methods: { - ...mapActions('auth', ['logout']), - async logout() { + ...mapActions(useAuthStore, ['logout']), + async handleLogout() { try { await this.logout() this.$router.push('/login') diff --git a/components/NavBarEditar.vue b/components/NavBarEditar.vue index 8668c74..e03e48f 100644 --- a/components/NavBarEditar.vue +++ b/components/NavBarEditar.vue @@ -13,12 +13,13 @@ to="/editar/productos/importar" >Importar - Cerrar sesión + Cerrar sesión