Actually destroy the OAuth session on token revokation
This commit is contained in:
@@ -305,13 +305,11 @@ angular.module('Application').controller('ProfileController', ['$scope', '$locat
|
||||
}
|
||||
|
||||
$scope.revokeTokens = function () {
|
||||
asyncForEach($scope.activeClients, revokeTokensByClient, function () {
|
||||
|
||||
// now kill this session if exists
|
||||
if (!$scope.webadminClient || !$scope.webadminClient.id) return;
|
||||
|
||||
revokeTokensByClient($scope.webadminClient, function () {
|
||||
// we should be logged out by now
|
||||
// first revoke all non webadmin tokens
|
||||
asyncForEach($scope.activeClients.filter(function (c) { return c.id !== 'cid-webadmin'; }), revokeTokensByClient, function () {
|
||||
// WARNING keep in sync with clients.js in box code
|
||||
revokeTokensByClient('cid-webadmin', function () {
|
||||
Client.logout(); // this destroys the OAuth session
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user