@schibsted/account-sdk-browser 4.8.7-beta.4 → 4.8.7-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/global.js +23 -11
- package/es5/global.js.map +1 -1
- package/es5/global.min.js +1 -1
- package/es5/global.min.js.map +1 -1
- package/es5/identity.js +23 -11
- package/es5/identity.js.map +1 -1
- package/es5/identity.min.js +1 -1
- package/es5/identity.min.js.map +1 -1
- package/es5/index.js +23 -11
- package/es5/index.js.map +1 -1
- package/es5/index.min.js +1 -1
- package/es5/index.min.js.map +1 -1
- package/es5/monetization.js +1 -1
- package/es5/monetization.js.map +1 -1
- package/es5/monetization.min.js +1 -1
- package/es5/monetization.min.js.map +1 -1
- package/package.json +1 -1
- package/src/identity.js +15 -0
- package/src/version.js +1 -1
package/package.json
CHANGED
package/src/identity.js
CHANGED
|
@@ -188,6 +188,10 @@ export class Identity extends EventEmitter {
|
|
|
188
188
|
this.log = log;
|
|
189
189
|
this.callbackBeforeRedirect = callbackBeforeRedirect;
|
|
190
190
|
this._sessionDomain = sessionDomain;
|
|
191
|
+
if (this._enableSessionCaching) {
|
|
192
|
+
const expiresIn = 1000 * 300;
|
|
193
|
+
this.cache.set("sessionFlowOngoing", false, expiresIn);
|
|
194
|
+
}
|
|
191
195
|
|
|
192
196
|
// Internal hack: set to false to always refresh from hassession
|
|
193
197
|
this._enableSessionCaching = true;
|
|
@@ -490,6 +494,12 @@ export class Identity extends EventEmitter {
|
|
|
490
494
|
* @return {Promise<HasSessionSuccessResponse|HasSessionFailureResponse>}
|
|
491
495
|
*/
|
|
492
496
|
hasSession() {
|
|
497
|
+
const checkIfSessionOngoing = this.cache.get("sessionFlowOngoing");
|
|
498
|
+
if (checkIfSessionOngoing)
|
|
499
|
+
{
|
|
500
|
+
return this._session;
|
|
501
|
+
}
|
|
502
|
+
|
|
493
503
|
if (this._hasSessionInProgress) {
|
|
494
504
|
return this._hasSessionInProgress;
|
|
495
505
|
}
|
|
@@ -533,6 +543,11 @@ export class Identity extends EventEmitter {
|
|
|
533
543
|
if (sessionData){
|
|
534
544
|
// for expiring session and safari browser do full page redirect to gain new session
|
|
535
545
|
if(_checkRedirectionNeed(sessionData)){
|
|
546
|
+
if (this._enableSessionCaching) {
|
|
547
|
+
const expiresIn = 1000 * 300;
|
|
548
|
+
this.cache.set("sessionFlowOngoing", true, expiresIn);
|
|
549
|
+
}
|
|
550
|
+
|
|
536
551
|
await this.callbackBeforeRedirect();
|
|
537
552
|
|
|
538
553
|
return this._sessionService.makeUrl(sessionData.redirectURL);
|
package/src/version.js
CHANGED