Try to refresh on startup
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma 2020-01-20 17:26:35 +01:00
parent f99dfc965f
commit 9103753b09

View File

@ -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 {