jose-browser-runtime
Advanced tools
Comparing version 4.13.0 to 4.13.1
@@ -49,29 +49,17 @@ import fetchJwks from '../runtime/fetch_jwks.js'; | ||
if (this._pendingFetch && isCloudflareWorkers()) { | ||
return new Promise((resolve) => { | ||
const isDone = () => { | ||
if (this._pendingFetch === undefined) { | ||
resolve(); | ||
} | ||
else { | ||
setTimeout(isDone, 5); | ||
} | ||
}; | ||
isDone(); | ||
}); | ||
this._pendingFetch = undefined; | ||
} | ||
if (!this._pendingFetch) { | ||
this._pendingFetch = fetchJwks(this._url, this._timeoutDuration, this._options) | ||
.then((json) => { | ||
if (!isJWKSLike(json)) { | ||
throw new JWKSInvalid('JSON Web Key Set malformed'); | ||
} | ||
this._jwks = { keys: json.keys }; | ||
this._jwksTimestamp = Date.now(); | ||
this._pendingFetch = undefined; | ||
}) | ||
.catch((err) => { | ||
this._pendingFetch = undefined; | ||
throw err; | ||
}); | ||
} | ||
this._pendingFetch || (this._pendingFetch = fetchJwks(this._url, this._timeoutDuration, this._options) | ||
.then((json) => { | ||
if (!isJWKSLike(json)) { | ||
throw new JWKSInvalid('JSON Web Key Set malformed'); | ||
} | ||
this._jwks = { keys: json.keys }; | ||
this._jwksTimestamp = Date.now(); | ||
this._pendingFetch = undefined; | ||
}) | ||
.catch((err) => { | ||
this._pendingFetch = undefined; | ||
throw err; | ||
})); | ||
await this._pendingFetch; | ||
@@ -78,0 +66,0 @@ } |
{ | ||
"name": "jose-browser-runtime", | ||
"version": "4.13.0", | ||
"version": "4.13.1", | ||
"homepage": "https://github.com/panva/jose", | ||
@@ -5,0 +5,0 @@ "repository": "panva/jose", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
232104
5806