oidc: use better json based file store for objects

This commit is contained in:
Johannes Zellner
2023-03-24 20:08:17 +01:00
parent 44706b9c70
commit 99e0979c2e
7 changed files with 129 additions and 47 deletions

View File

@@ -1929,6 +1929,15 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.destroyOidcSession = function (callback) {
del('/api/v1/oidc/sessions', null, function (error, data, status) {
if (error) return callback(error);
if (status !== 204) return callback(new ClientError(status, data));
callback(null);
});
};
Client.prototype.getOidcClients = function (callback) {
get('/api/v1/oidc/clients', null, function (error, data, status) {
if (error) return callback(error);

View File

@@ -542,10 +542,9 @@
<div class="row">
<div class="col-xs-12">
<p>{{ 'profile.loginTokens.description' | tr:{ webadminTokenCount: tokens.webadminTokens.length, cliTokenCount: cliTokens.length } }}</p>
<button class="btn btn-outline btn-danger pull-right" ng-click="tokens.revokeAllWebAndCliTokens()" ng-disabled="tokens.busy"><i class="fa fa-circle-notch fa-spin" ng-show="tokens.busy"></i> {{ 'profile.loginTokens.logoutAll' | tr }}</button>
<br/>
<button class="btn btn-outline btn-danger pull-right" ng-click="logoutFromAll()" ng-disabled="tokens.busy"><i class="fa fa-circle-notch fa-spin" ng-show="tokens.busy"></i> {{ 'profile.loginTokens.logoutAll' | tr }}</button>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -709,6 +709,14 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
}
};
$scope.logoutFromAll = function () {
Client.destroyOidcSession(function (error) {
if (error) console.error('Failed to destroy oidc session', error);
$scope.tokens.revokeAllWebAndCliTokens();
});
};
Client.onReady(function () {
$scope.appPassword.refresh();
$scope.tokens.refresh();