Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move navigation in hasSessionInProgress #271

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading