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. *