Skip to content

Commit

Permalink
fix: move navigation in hasSessionInProgress (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-niculescu-sch authored Apr 3, 2024
1 parent cc74052 commit b17a705
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@schibsted/account-sdk-browser",
"version": "4.8.7-beta.3",
"version": "4.8.7-beta.4",
"description": "Schibsted account SDK for browsers",
"main": "index.js",
"type": "module",
Expand Down
11 changes: 7 additions & 4 deletions src/identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,14 +530,12 @@ export class Identity extends EventEmitter {
throw err;
}

if(sessionData){
if (sessionData){
// for expiring session and safari browser do full page redirect to gain new session
if(_checkRedirectionNeed(sessionData)){
await this.callbackBeforeRedirect();

this.window.location.href = this._sessionService.makeUrl(sessionData.redirectURL);

return;
return this._sessionService.makeUrl(sessionData.redirectURL);
}

if (this._enableSessionCaching) {
Expand All @@ -552,6 +550,11 @@ export class Identity extends EventEmitter {
.then(
sessionData => {
this._hasSessionInProgress = false;

if (typeof sessionData === 'string' && isUrl(sessionData)) {
return this.window.location.href = sessionData;
}

return sessionData;
},
err => {
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Automatically generated in 'npm version' by scripts/genversion.js

'use strict'
const version = '4.8.7-beta.3';
const version = '4.8.7-beta.4';
export default version;

0 comments on commit b17a705

Please sign in to comment.