diff --git a/main.js b/main.js index c1030de..dc3df31 100644 --- a/main.js +++ b/main.js @@ -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; }