@bytescale/sdk 3.0.0-alpha.7 → 3.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser/cjs/main.js
CHANGED
|
@@ -2482,6 +2482,7 @@ var AuthManager = /*#__PURE__*/function (_BaseAPI) {
|
|
|
2482
2482
|
_this.contentTypeJson = "application/json";
|
|
2483
2483
|
_this.contentTypeText = "text/plain";
|
|
2484
2484
|
_this.minJwtTtlSeconds = 10;
|
|
2485
|
+
_this.maxJwtTtlSeconds = 2147483; // Max value for window.setTimeout is 2147483647ms -- if we go over this, the timeout fires immediately.
|
|
2485
2486
|
_this.retryAuthAfterErrorSeconds = 5;
|
|
2486
2487
|
_this.refreshBeforeExpirySeconds = 20;
|
|
2487
2488
|
var cdnUrl = BytescaleApiClientConfigUtils.getCdnUrl(config);
|
|
@@ -2564,6 +2565,8 @@ var AuthManager = /*#__PURE__*/function (_BaseAPI) {
|
|
|
2564
2565
|
if (desiredTtl !== timeout) {
|
|
2565
2566
|
ConsoleUtils.warn("JWT expiration is too short: waiting for ".concat(timeout, " seconds before refreshing."));
|
|
2566
2567
|
}
|
|
2568
|
+
// There's need to print a warning for this: it's OK to silently request the JWT before it expires. Also, this is 24 days in this case!
|
|
2569
|
+
timeout = Math.min(timeout, _this7.maxJwtTtlSeconds);
|
|
2567
2570
|
session.accessToken = setTokenResult.accessToken;
|
|
2568
2571
|
});
|
|
2569
2572
|
});
|