[API] Fixed logout loop
This commit is contained in:
parent
73a5de021d
commit
b8531ad816
|
@ -94,14 +94,15 @@ export const useMainStore = defineStore({
|
||||||
LocalStorage.clear();
|
LocalStorage.clear();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await api.delete(`/auth/${this.session.token}`);
|
const token = this.session.token;
|
||||||
} catch (error) {
|
|
||||||
return false;
|
|
||||||
} finally {
|
|
||||||
this.$patch({
|
this.$patch({
|
||||||
session: undefined,
|
session: undefined,
|
||||||
user: undefined,
|
user: undefined,
|
||||||
});
|
});
|
||||||
|
await api.delete(`/auth/${token}`);
|
||||||
|
} catch (error) {
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
SessionStorage.clear();
|
SessionStorage.clear();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue