@schibsted/account-sdk-browser 4.8.7-beta.4 → 4.8.7-beta.5

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
@@ -1159,6 +1159,7 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
1159
1159
  _this.log = log;
1160
1160
  _this.callbackBeforeRedirect = callbackBeforeRedirect;
1161
1161
  _this._sessionDomain = sessionDomain;
1162
+ _this.cache.set("sessionFlowOngoing", false);
1162
1163
 
1163
1164
  // Internal hack: set to false to always refresh from hassession
1164
1165
  _this._enableSessionCaching = true;
@@ -1482,6 +1483,10 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
1482
1483
  key: "hasSession",
1483
1484
  value: function hasSession() {
1484
1485
  var _this2 = this;
1486
+ var checkIfSessionOngoing = this.cache.get("sessionFlowOngoing");
1487
+ if (checkIfSessionOngoing) {
1488
+ return this._session;
1489
+ }
1485
1490
  if (this._hasSessionInProgress) {
1486
1491
  return this._hasSessionInProgress;
1487
1492
  }
@@ -1537,25 +1542,26 @@ var Identity = /*#__PURE__*/function (_EventEmitter) {
1537
1542
  throw _context.t0;
1538
1543
  case 15:
1539
1544
  if (!sessionData) {
1540
- _context.next = 21;
1545
+ _context.next = 22;
1541
1546
  break;
1542
1547
  }
1543
1548
  if (!_checkRedirectionNeed(sessionData)) {
1544
- _context.next = 20;
1549
+ _context.next = 21;
1545
1550
  break;
1546
1551
  }
1547
- _context.next = 19;
1552
+ _this2.cache.set("sessionFlowOngoing", true);
1553
+ _context.next = 20;
1548
1554
  return _this2.callbackBeforeRedirect();
1549
- case 19:
1550
- return _context.abrupt("return", _this2._sessionService.makeUrl(sessionData.redirectURL));
1551
1555
  case 20:
1556
+ return _context.abrupt("return", _this2._sessionService.makeUrl(sessionData.redirectURL));
1557
+ case 21:
1552
1558
  if (_this2._enableSessionCaching) {
1553
1559
  _expiresIn = 1000 * (sessionData.expiresIn || 300);
1554
1560
  _this2.cache.set(HAS_SESSION_CACHE_KEY, sessionData, _expiresIn);
1555
1561
  }
1556
- case 21:
1557
- return _context.abrupt("return", _postProcess(sessionData));
1558
1562
  case 22:
1563
+ return _context.abrupt("return", _postProcess(sessionData));
1564
+ case 23:
1559
1565
  case "end":
1560
1566
  return _context.stop();
1561
1567
  }
@@ -11932,7 +11938,7 @@ __webpack_require__.r(__webpack_exports__);
11932
11938
 
11933
11939
 
11934
11940
 
11935
- var version = '4.8.7-beta.4';
11941
+ var version = '4.8.7-beta.5';
11936
11942
  /* harmony default export */ __webpack_exports__["default"] = (version);
11937
11943
 
11938
11944
  /***/ }),