Reset the user store on unauthenticated HTTP response

This commit is contained in:
Bubka
2023-09-28 13:23:58 +02:00
parent 73e36edd9c
commit fe9002501b
2 changed files with 10 additions and 6 deletions

View File

@ -34,14 +34,18 @@ export const useUserStore = defineStore({
}
else {
return authService.logout().then(() => {
localStorage.clear()
this.$reset()
router.push({ name: 'login' })
this.reset()
})
// this.$router.push({ name: 'login', params: { forceRefresh: true } })
}
// },
},
reset() {
localStorage.clear()
this.$reset()
router.push({ name: 'login' })
}
},