@schibsted/account-sdk-browser 4.8.7-beta.2 → 4.8.7-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schibsted/account-sdk-browser",
3
- "version": "4.8.7-beta.2",
3
+ "version": "4.8.7-beta.4",
4
4
  "description": "Schibsted account SDK for browsers",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/identity.d.ts CHANGED
@@ -558,11 +558,6 @@ export type HasSessionSuccessResponse = {
558
558
  * - (Only for connected users)
559
559
  */
560
560
  defaultAgreementAccepted: boolean;
561
- } | {
562
- /**
563
- * Used for expiring session in Safari browser to indicate redirection need
564
- */
565
- redirectURL: string;
566
561
  };
567
562
  export type HasSessionFailureResponse = {
568
563
  error: {
package/src/identity.js CHANGED
@@ -530,14 +530,12 @@ export class Identity extends EventEmitter {
530
530
  throw err;
531
531
  }
532
532
 
533
- if(sessionData){
533
+ if (sessionData){
534
534
  // for expiring session and safari browser do full page redirect to gain new session
535
535
  if(_checkRedirectionNeed(sessionData)){
536
536
  await this.callbackBeforeRedirect();
537
537
 
538
- this.window.location.href = this._sessionService.makeUrl(sessionData.redirectURL);
539
-
540
- return;
538
+ return this._sessionService.makeUrl(sessionData.redirectURL);
541
539
  }
542
540
 
543
541
  if (this._enableSessionCaching) {
@@ -552,6 +550,11 @@ export class Identity extends EventEmitter {
552
550
  .then(
553
551
  sessionData => {
554
552
  this._hasSessionInProgress = false;
553
+
554
+ if (typeof sessionData === 'string' && isUrl(sessionData)) {
555
+ return this.window.location.href = sessionData;
556
+ }
557
+
555
558
  return sessionData;
556
559
  },
557
560
  err => {
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.2';
4
+ const version = '4.8.7-beta.4';
5
5
  export default version;