mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-17 00:51:04 +02:00
Reset the user store on unauthenticated HTTP response
This commit is contained in:
10
resources/js_vue3/stores/user.js
vendored
10
resources/js_vue3/stores/user.js
vendored
@ -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' })
|
||||
}
|
||||
|
||||
},
|
||||
|
Reference in New Issue
Block a user