oidc dashboard login

This commit is contained in:
Johannes Zellner
2023-06-02 20:47:36 +02:00
parent 35efdf6cbd
commit 2c334170bd
6 changed files with 97 additions and 13 deletions

View File

@@ -2713,15 +2713,22 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
Client.prototype.login = function () {
this.setToken(null);
window.location.href = '/login.html?returnTo=/' + encodeURIComponent(window.location.hash);
// start oidc flow
window.location.href = '/openid/auth?client_id=dashboard&scope=openid email profile&response_type=code token&redirect_uri=' + window.location.origin + '/authcallback.html';
// window.location.href = '/login.html?returnTo=/' + encodeURIComponent(window.location.hash);
};
Client.prototype.logout = function () {
var token = this.getToken();
this.setToken(null);
var that = this;
// invalidates the token
window.location.href = client.apiOrigin + '/api/v1/cloudron/logout?access_token=' + token;
// destroy oidc session in the spirit of true SSO
del('/api/v1/oidc/sessions', null, function (error, data, status) {
if (error) console.error('Failed to logout from oidc session');
that.setToken(null);
window.location.href = '/';
});
};
Client.prototype.getAppEventLog = function (appId, page, perPage, callback) {