Cleaner logout.
This commit is contained in:
parent
b324276173
commit
b0a1bb72dc
@ -130,8 +130,7 @@ export const useAuthStore = defineStore('auth', {
|
|||||||
async logout() {
|
async logout() {
|
||||||
try {
|
try {
|
||||||
await fetch('/auth/api/logout', {method: 'POST'})
|
await fetch('/auth/api/logout', {method: 'POST'})
|
||||||
this.userInfo = null
|
location.reload()
|
||||||
if (this.restrictedMode) location.reload()
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Logout error:', error)
|
console.error('Logout error:', error)
|
||||||
this.showMessage(error.message, 'error')
|
this.showMessage(error.message, 'error')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user