Skip to content
Snippets Groups Projects
Verified Commit 9d350620 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

[web] fix/improve discovery and providers.find not defined

parent e167758f
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,8 @@
- Webinterface: Improved the title / placeholder for the `hosts` restrictions key in the GUI editor to make it more
clear that also subnets can be used.
- Webinterface: Changed the login provider selector and added search functionality
- Webinterface: Improved (re-)discovery of mytoken configuration
- Webinterface: Fixed a problem with scope discovery if there was no OP selected.
- Profiles: Improved / Fixed includes in especially restrictions when includes involve arrays.
### Bugfixes
......
......@@ -12,7 +12,7 @@ const configElements = [
function discovery(...next) {
try {
const discovery = storageGet('discovery');
if (discovery !== null && discovery !== undefined) {
if (discovery !== null && discovery !== undefined && discovery > (Date.now() / 1000 - 3600)) {
doNext(...next);
return;
}
......@@ -23,7 +23,7 @@ function discovery(...next) {
configElements.forEach(function (el) {
storageSet(el, res[el]);
})
storageSet('discovery', Date.now())
storageSet('discovery', Date.now() / 1000)
doNext(...next);
}
});
......
......@@ -114,7 +114,11 @@ function getSupportedScopesFromStorage(iss = "") {
iss = storageGet("oidc_issuer");
}
}
return providers.find(x => x.issuer === iss).scopes_supported;
let p = providers.find(x => x.issuer === iss)
if (p === undefined) {
return [];
}
return p.scopes_supported;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment