diff --git a/projects/common/src/fm/shared/app.config.factory.ts b/projects/common/src/fm/shared/app.config.factory.ts index 33f4b60..b7a8a2f 100644 --- a/projects/common/src/fm/shared/app.config.factory.ts +++ b/projects/common/src/fm/shared/app.config.factory.ts @@ -29,9 +29,10 @@ export function appConfigFactory(injector:Injector, appConfig: AppConfig, oauthS oauthService.setupAutomaticSilentRefresh(); let location = injector.get(Location); let router = injector.get(Router); + let urlPath = location.path(); oauthService.loadDiscoveryDocument().then(() => { oauthService.tryLoginCodeFlow().then(() => { - router.navigateByUrl(decodeURIComponent(oauthService.state)); + router.navigateByUrl((oauthService.state && oauthService.state!="")?decodeURIComponent(oauthService.state):urlPath); }); }) }).then(() => {