@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schibsted/account-sdk-browser",
3
- "version": "4.8.7-beta.4",
3
+ "version": "4.8.7-beta.5",
4
4
  "description": "Schibsted account SDK for browsers",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/identity.js CHANGED
@@ -188,6 +188,7 @@ export class Identity extends EventEmitter {
188
188
  this.log = log;
189
189
  this.callbackBeforeRedirect = callbackBeforeRedirect;
190
190
  this._sessionDomain = sessionDomain;
191
+ this.cache.set("sessionFlowOngoing", false);
191
192
 
192
193
  // Internal hack: set to false to always refresh from hassession
193
194
  this._enableSessionCaching = true;
@@ -490,6 +491,12 @@ export class Identity extends EventEmitter {
490
491
  * @return {Promise<HasSessionSuccessResponse|HasSessionFailureResponse>}
491
492
  */
492
493
  hasSession() {
494
+ const checkIfSessionOngoing = this.cache.get("sessionFlowOngoing");
495
+ if (checkIfSessionOngoing)
496
+ {
497
+ return this._session;
498
+ }
499
+
493
500
  if (this._hasSessionInProgress) {
494
501
  return this._hasSessionInProgress;
495
502
  }
@@ -533,6 +540,7 @@ export class Identity extends EventEmitter {
533
540
  if (sessionData){
534
541
  // for expiring session and safari browser do full page redirect to gain new session
535
542
  if(_checkRedirectionNeed(sessionData)){
543
+ this.cache.set("sessionFlowOngoing", true);
536
544
  await this.callbackBeforeRedirect();
537
545
 
538
546
  return this._sessionService.makeUrl(sessionData.redirectURL);
package/src/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Automatically generated in 'npm version' by scripts/genversion.js
2
2
 
3
3
  'use strict'
4
- const version = '4.8.7-beta.4';
4
+ const version = '4.8.7-beta.5';
5
5
  export default version;