From 838646f08555e15fac49692032e2b6b82518beaf Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 28 May 2019 09:13:11 +0200 Subject: [PATCH] MOBILE-3039 core: Fix load logged out site with SSO --- src/core/login/providers/helper.ts | 2 ++ src/providers/sites.ts | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/core/login/providers/helper.ts b/src/core/login/providers/helper.ts index af5b97243..2d4bbc62f 100644 --- a/src/core/login/providers/helper.ts +++ b/src/core/login/providers/helper.ts @@ -938,6 +938,8 @@ export class CoreLoginHelperProvider { promise.then(() => { this.waitingForBrowser = true; + this.sitesProvider.unsetCurrentSite(); // We need to unset current site to make authentication work fine. + this.openBrowserForSSOLogin(result.siteUrl, result.code, result.service, result.config && result.config.launchurl, data.pageName, data.params); }).catch(() => { diff --git a/src/providers/sites.ts b/src/providers/sites.ts index 31fc08b64..de7424c1b 100644 --- a/src/providers/sites.ts +++ b/src/providers/sites.ts @@ -1181,6 +1181,13 @@ export class CoreSitesProvider { }); } + /** + * Unset current site. + */ + unsetCurrentSite(): void { + this.currentSite = undefined; + } + /** * Updates a site's token. *