Add option to logout to destroy all sessions by this user

This commit is contained in:
Johannes Zellner
2019-11-08 21:33:17 +01:00
parent 3fecb777e8
commit f6b88518a2
2 changed files with 3 additions and 3 deletions

View File

@@ -1703,13 +1703,13 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
window.location.href = this.apiOrigin + '/api/v1/oauth/dialog/authorize?response_type=token&client_id=' + this._clientId + '&redirect_uri=' + callbackURL + '&scope=' + scope + '&state=' + state;
};
Client.prototype.logout = function () {
Client.prototype.logout = function (allSessions) {
this.setToken(null);
this._userInfo = {};
// logout from OAuth session
var origin = window.location.protocol + '//' + window.location.host;
window.location.href = this.apiOrigin + '/api/v1/session/logout?redirect=' + origin;
window.location.href = this.apiOrigin + '/api/v1/session/logout?redirect=' + origin + (allSessions ? '&all=true' : '');
};
// this is ununsed because webadmin uses implicit grant flow