From 62d5779c754735aa2da711f858299b16cae5e1f0 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Thu, 23 Apr 2020 11:11:07 +0200 Subject: [PATCH] Fix url at page refresh --- projects/common/src/fm/shared/app.config.factory.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(() => {