@schibsted/account-sdk-browser 4.8.6-beta → 4.8.6-beta.2

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.6-beta",
3
+ "version": "4.8.6-beta.2",
4
4
  "description": "Schibsted account SDK for browsers",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/identity.js CHANGED
@@ -495,10 +495,6 @@ export class Identity extends EventEmitter {
495
495
  const isRedirectNeeded = sessionDataKeys.length === 1 &&
496
496
  sessionDataKeys[0] === 'redirectURL';
497
497
 
498
- if(isRedirectNeeded && !isUrl(sessionData.redirectURL)){
499
- throw new SDKError('Session refresh url is not valid');
500
- }
501
-
502
498
  return isRedirectNeeded;
503
499
  }
504
500
  const _getSession = async () => {
@@ -523,7 +519,11 @@ export class Identity extends EventEmitter {
523
519
  if(sessionData){
524
520
  // for expiring session and safari browser do full page redirect to gain new session
525
521
  if(_checkRedirectionNeed(sessionData)){
526
- window.location.replace(sessionData.redirectURL);
522
+ const client_sdrn = `sdrn:${NAMESPACE[this.env]}:client:${this.clientId}`;
523
+ const redirectBackUrl = this.redirectUri.substring(0 , this.redirectUri.lastIndexOf('/'));
524
+ const params = { redirect_uri: redirectBackUrl, client_sdrn: client_sdrn};
525
+ this.emit('redirectToSessionService');
526
+ this.window.location.href = this._sessionService.makeUrl(sessionData.redirectURL.substring(sessionData.redirectURL.lastIndexOf('/')), params);
527
527
  return;
528
528
  }
529
529
 
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.5';
4
+ const version = '4.8.6-beta.2';
5
5
  export default version;