pass clientId instead of client object to revoke

This commit is contained in:
Girish Ramakrishnan
2019-11-11 09:20:42 -08:00
parent 40b75c6ac8
commit f679746e63

View File

@@ -297,8 +297,8 @@ angular.module('Application').controller('ProfileController', ['$scope', '$locat
}
};
function revokeTokensByClient(client, callback) {
Client.delTokensByClientId(client.id, function (error) {
function revokeTokensByClient(clientId, callback) {
Client.delTokensByClientId(clientId, function (error) {
if (error) console.error(error);
callback();
});
@@ -306,7 +306,8 @@ angular.module('Application').controller('ProfileController', ['$scope', '$locat
$scope.revokeTokens = function () {
// first revoke all non webadmin tokens
asyncForEach($scope.activeClients.filter(function (c) { return c.id !== 'cid-webadmin'; }), revokeTokensByClient, function () {
var nonWebClientIds = $scope.activeClients.filter(function (c) { return c.id !== 'cid-webadmin'; }).map(function (c) { return c.id; });
asyncForEach(nonWebClientIds, revokeTokensByClient, function () {
// WARNING keep in sync with clients.js in box code
revokeTokensByClient('cid-webadmin', function () {
Client.logout(true /* destroy all OAuth sessions for this user */);