From 9103753b0907728fda83955ffbd30499d22ec894 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Mon, 20 Jan 2020 17:26:35 +0100 Subject: [PATCH] Try to refresh on startup --- projects/common/src/fm/shared/app.config.factory.ts | 6 +++++- 1 file changed, 5 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 e60dd5c..6a6d66d 100644 --- a/projects/common/src/fm/shared/app.config.factory.ts +++ b/projects/common/src/fm/shared/app.config.factory.ts @@ -39,7 +39,11 @@ export function appConfigFactory(injector:Injector, appConfig: AppConfig, oauthS let router = injector.get(Router); if (!oauthService.hasValidAccessToken()) { if(appConfig.getConfig("grantType") == "code") - oauthService.initCodeFlow(urlPath); + if(oauthService.getRefreshToken() != null ) { + oauthService.refreshToken(); + } else { + oauthService.initCodeFlow(urlPath); + } else oauthService.initImplicitFlow(urlPath); } else {