@schibsted/account-sdk-browser 5.0.1-beta.4 → 5.0.1-beta.6

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/es5/index.js CHANGED
@@ -1108,7 +1108,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
1108
1108
 
1109
1109
  var HAS_SESSION_CACHE_KEY = 'hasSession-cache';
1110
1110
  var SESSION_CALL_BLOCKED_CACHE_KEY = 'sessionCallBlocked-cache';
1111
- var SESSION_CALL_BLOCKED_TTL = 1000 * 30; //set to 30s, the default period for a request timeout
1111
+ var SESSION_CALL_BLOCKED_TTL = 1000 * 15; //set to 15s, to not block calls much longer than the time attempting retries
1112
1112
 
1113
1113
  var TAB_ID_KEY = 'tab-id-cache';
1114
1114
  var TAB_ID = Math.floor(Math.random() * 100000);
@@ -1182,7 +1182,6 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
1182
1182
  _this._setBffServerUrl(env);
1183
1183
  _this._setOauthServerUrl(env);
1184
1184
  _this._setGlobalSessionServiceUrl(env);
1185
- _this._unblockSessionCallByTab();
1186
1185
  return _this;
1187
1186
  }
1188
1187
 
@@ -1206,15 +1205,14 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
1206
1205
  }
1207
1206
 
1208
1207
  /**
1209
- * Checks if calling GET session is blocked by a cache storage
1208
+ * Checks if calling GET session is blocked
1210
1209
  * @private
1211
- * @param {Cache} cache - cache to check
1212
1210
  * @returns {string|null}
1213
1211
  */
1214
1212
  }, {
1215
1213
  key: "_isSessionCallBlocked",
1216
- value: function _isSessionCallBlocked(cache) {
1217
- return cache.get(SESSION_CALL_BLOCKED_CACHE_KEY);
1214
+ value: function _isSessionCallBlocked() {
1215
+ return this.localStorageCache.get(SESSION_CALL_BLOCKED_CACHE_KEY);
1218
1216
  }
1219
1217
 
1220
1218
  /**
@@ -1225,10 +1223,6 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
1225
1223
  }, {
1226
1224
  key: "_blockSessionCall",
1227
1225
  value: function _blockSessionCall() {
1228
- // session storage block protects against single tab, multiple identity instance concurrency
1229
- this.sessionStorageCache.set(SESSION_CALL_BLOCKED_CACHE_KEY, this._tabId, SESSION_CALL_BLOCKED_TTL);
1230
-
1231
- // local storage block protects against cross-tab concurrency
1232
1226
  this.localStorageCache.set(SESSION_CALL_BLOCKED_CACHE_KEY, this._tabId, SESSION_CALL_BLOCKED_TTL);
1233
1227
  }
1234
1228
 
@@ -1240,10 +1234,9 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
1240
1234
  }, {
1241
1235
  key: "_unblockSessionCallByTab",
1242
1236
  value: function _unblockSessionCallByTab() {
1243
- if (this._isSessionCallBlocked(this.localStorageCache) === this._tabId) {
1237
+ if (this._isSessionCallBlocked() === this._tabId) {
1244
1238
  this.localStorageCache.delete(SESSION_CALL_BLOCKED_CACHE_KEY);
1245
1239
  }
1246
- this.sessionStorageCache.delete(SESSION_CALL_BLOCKED_CACHE_KEY);
1247
1240
  }
1248
1241
 
1249
1242
  /**
@@ -1668,7 +1661,7 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
1668
1661
  }
1669
1662
  return _context3.abrupt("return", _postProcess(cachedSession));
1670
1663
  case 4:
1671
- if (!(_this2._isSessionCallBlocked(_this2.sessionStorageCache) || _this2._isSessionCallBlocked(_this2.localStorageCache))) {
1664
+ if (!_this2._isSessionCallBlocked()) {
1672
1665
  _context3.next = 13;
1673
1666
  break;
1674
1667
  }
@@ -12150,7 +12143,7 @@ __webpack_require__.r(__webpack_exports__);
12150
12143
 
12151
12144
 
12152
12145
 
12153
- var version = '5.0.1-beta.4';
12146
+ var version = '5.0.1-beta.6';
12154
12147
  /* harmony default export */ __webpack_exports__["default"] = (version);
12155
12148
 
12156
12149
  /***/ }),