diff --git a/src/core/guards/redirect.ts b/src/core/guards/redirect.ts index 248518aaa..5217a123a 100644 --- a/src/core/guards/redirect.ts +++ b/src/core/guards/redirect.ts @@ -76,11 +76,7 @@ export class CoreRedirectGuard implements CanLoad, CanActivate { // Redirect to non-site path. const route = Router.parseUrl(redirect.page); - - route.queryParams = { - redirectPath: redirect.page, - redirectOptions: redirect.options, - } as CoreRedirectPayload; + route.queryParams = redirect.options?.params || {}; return route; } diff --git a/src/core/services/navigator.ts b/src/core/services/navigator.ts index 1b47f19ed..8707bf47d 100644 --- a/src/core/services/navigator.ts +++ b/src/core/services/navigator.ts @@ -201,14 +201,6 @@ export class CoreNavigatorService { const siteId = options.siteId ?? CoreSites.getCurrentSiteId(); const navigationOptions: CoreNavigationOptions = CoreObject.without(options, ['siteId']); - // If the path doesn't belong to a site, call standard navigation. - if (siteId === CoreConstants.NO_SITE_ID) { - return this.navigate(path, { - ...navigationOptions, - reset: true, - }); - } - // If we are logged into a different site, log out first. if (CoreSites.isLoggedIn() && CoreSites.getCurrentSiteId() !== siteId) { if (CoreSitePlugins.hasSitePluginsLoaded) { @@ -223,6 +215,14 @@ export class CoreNavigatorService { await CoreSites.logout(); } + // If the path doesn't belong to a site, call standard navigation. + if (siteId === CoreConstants.NO_SITE_ID) { + return this.navigate(path, { + ...navigationOptions, + reset: true, + }); + } + // If we are not logged into the site, load the site. if (!CoreSites.isLoggedIn()) { const modal = await CoreDomUtils.showModalLoading();