fix logout action

This commit is contained in:
María
2025-08-27 10:55:25 +02:00
parent a9a525d858
commit 5577628c56
6 changed files with 59 additions and 32 deletions

View File

@@ -95,7 +95,7 @@
<span class="section-text login">Importar</span>
</li>
</NuxtLink>
<NuxtLink v-if="isAuthenticated" @click="logout" to="/">
<NuxtLink v-if="isAuthenticated" @click="handleLogout" to="/">
<li class="section" @click="isMenuOpen = !isMenuOpen">
<img
class="section-img"
@@ -145,6 +145,7 @@ import { mapActions } from 'pinia'
import { useAuthStore } from '@/stores/auth'
export default {
emits: ['handleLogout'],
setup() {
const auth = useAuthStore();
return {
@@ -165,11 +166,11 @@ export default {
},
},
methods: {
...mapActions('auth', ['logout']),
async logout() {
...mapActions(useAuthStore, ['logout']),
async handleLogout() {
this.isMenuOpen = false
this.$emit('logout')
await this.logout()
this.$emit('handleLogout')
//await this.logout()
},
},
}