Fix logout

This commit is contained in:
Midgard 2020-03-26 17:46:22 +01:00
parent 02a1bad183
commit 6b812e849e
Signed by: midgard
GPG Key ID: 511C112F1331BBB4
1 changed files with 5 additions and 1 deletions

View File

@ -88,7 +88,11 @@ class MattermostClient {
}
async logOut() {
const response = await this.api.post("/users/logout");
const stored = this.storage.get(this.api.id);
if (!stored || !stored.token) {
throw Error("No token stored");
}
const response = await this.api.post("/users/logout", undefined, stored.token);
//this.storage.clear(this.api.id);
return response.responseJson;
}