Skip to content

Commit

Permalink
Fix user switching to log out backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwalton3 committed Apr 7, 2020
1 parent ea2d5be commit d575527
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libraries/apiclient/apiclientcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@ define(["events", "appStorage"], function(events, appStorage) {
appStorage.removeItem("user-" + this._currentUser.Id + "-" + this._currentUser.ServerId)
this.setAuthenticationInfo(null, null)
}.bind(this);

// MPV Shim Logout Callback
// There is almost certainly a better place to do this.
var xhr = new XMLHttpRequest();
xhr.open('POST', "/destroy_session", true);
xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
xhr.send("{}");

if (this.accessToken()) {
var url = this.getUrl("Sessions/Logout");
return this.ajax({
Expand Down

0 comments on commit d575527

Please sign in to comment.