Patch up the token delete button with the route

This commit is contained in:
Johannes Zellner
2016-06-07 15:38:42 +02:00
parent 290ab6cc7d
commit 8144c6d086
3 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -261,7 +261,7 @@
<h4 class="text-muted">Your Tokens <button class="btn btn-xs btn-primary btn-outline pull-right" ng-click="tokenAdd.show(client)"><i class="fa fa-plus"></i> New Token</button></h4>
<p ng-repeat="token in client.activeTokens">
<b ng-click-select>{{ token.accessToken }}</b> <button class="btn btn-xs btn-danger pull-right" ng-click="" title="Revoke Token"><i class="fa fa-trash-o"></i></button>
<b ng-click-select>{{ token.accessToken }}</b> <button class="btn btn-xs btn-danger pull-right" ng-click="removeToken(client, token)" title="Revoke Token"><i class="fa fa-trash-o"></i></button>
</p>
</div>
</div>
+8
View File
@@ -252,6 +252,14 @@ angular.module('Application').controller('AccountController', ['$scope', '$locat
}
};
$scope.removeToken = function (client, token) {
Client.delToken(client.id, token.accessToken, function (error) {
if (error) console.error(error);
refreshClientTokens(client);
});
};
$scope.removeAccessTokens = function (client) {
client.busy = true;