Fix some for logout iam

This commit is contained in:
Montech
2026-10-11 17:00:31 +03:30
parent 025d223dac
commit c04505fbd8
204 changed files with 223 additions and 205 deletions
+13 -5
View File
@@ -93862,17 +93862,25 @@ var require_iam_logout_service = __commonJS({
const cached = kid ? this.keys.get(kid) : [...this.keys.values()][0];
if (cached && !stale)
return cached;
await this.loadKeys();
const key = kid ? this.keys.get(kid) : [...this.keys.values()][0];
await this.loadKeys(false);
let key = kid ? this.keys.get(kid) : [...this.keys.values()][0];
if (!key && kid) {
await this.loadKeys(true);
key = this.keys.get(kid);
}
if (!key)
throw new IamLogoutTokenError("no matching signing key at the identity service");
return key;
}
async loadKeys() {
async loadKeys(bypassCache) {
const uri = bypassCache ? `${this.iam.issuer}/.well-known/jwks.json?_=${Date.now()}` : `${this.iam.issuer}/.well-known/jwks.json`;
let response;
try {
response = await fetch(`${this.iam.issuer}/.well-known/jwks.json`, {
headers: { accept: "application/json" }
response = await fetch(uri, {
headers: {
accept: "application/json",
...bypassCache ? { "cache-control": "no-cache", pragma: "no-cache" } : {}
}
});
} catch (error) {
throw new iam_service_1.IamUnavailableError(`could not reach the identity service: ${error.message}`);