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

View file

@ -88,7 +88,11 @@ class MattermostClient {
} }
async logOut() { 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); //this.storage.clear(this.api.id);
return response.responseJson; return response.responseJson;
} }