@auth0/auth0-spa-js 1.22.3 → 1.22.4

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.
@@ -3612,7 +3612,7 @@
3612
3612
  exports.default = SuperTokensLock;
3613
3613
  }));
3614
3614
  var Lock = unwrapExports(browserTabsLock);
3615
- var version = "1.22.3";
3615
+ var version = "1.22.4";
3616
3616
  var DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS = 60;
3617
3617
  var DEFAULT_POPUP_CONFIG_OPTIONS = {
3618
3618
  timeoutInSeconds: DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS
@@ -4911,8 +4911,24 @@
4911
4911
  };
4912
4912
  var Auth0Client = function() {
4913
4913
  function Auth0Client(options) {
4914
+ var _this = this;
4914
4915
  var _a, _b;
4915
4916
  this.options = options;
4917
+ this._releaseLockOnPageHide = function() {
4918
+ return __awaiter(_this, void 0, void 0, (function() {
4919
+ return __generator(this, (function(_a) {
4920
+ switch (_a.label) {
4921
+ case 0:
4922
+ return [ 4, lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY) ];
4923
+
4924
+ case 1:
4925
+ _a.sent();
4926
+ window.removeEventListener("pagehide", this._releaseLockOnPageHide);
4927
+ return [ 2 ];
4928
+ }
4929
+ }));
4930
+ }));
4931
+ };
4916
4932
  typeof window !== "undefined" && validateCrypto();
4917
4933
  if (options.cache && options.cacheLocation) {
4918
4934
  console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`.");
@@ -5381,6 +5397,7 @@
5381
5397
 
5382
5398
  case 4:
5383
5399
  _b.trys.push([ 4, , 12, 14 ]);
5400
+ window.addEventListener("pagehide", this._releaseLockOnPageHide);
5384
5401
  if (!!ignoreCache) return [ 3, 6 ];
5385
5402
  return [ 4, this._getEntryFromCache({
5386
5403
  scope: getTokenOptions.scope,
@@ -5442,6 +5459,7 @@
5442
5459
 
5443
5460
  case 13:
5444
5461
  _b.sent();
5462
+ window.removeEventListener("pagehide", this._releaseLockOnPageHide);
5445
5463
  return [ 7 ];
5446
5464
 
5447
5465
  case 14: