Dev alepore 12511 fix bc wrong auth url (#8352)

* [AAE-12511] Wait for the app configuration to be set with the right idp configuration

* [AAE-12511] Wait for the api service to be loaded to fix AlfrescoApi instance undefined
This commit is contained in:
Amedeo Lepore
2023-03-10 17:48:29 +01:00
committed by GitHub
parent 8907a7ffa2
commit d1fa1a3cd7
2 changed files with 4 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ export class AlfrescoApiLoaderService {
return this.initAngularAlfrescoApi(); return this.initAngularAlfrescoApi();
} }
private initAngularAlfrescoApi() { private async initAngularAlfrescoApi() {
const oauth: OauthConfigModel = Object.assign({}, this.appConfig.get<OauthConfigModel>(AppConfigValues.OAUTHCONFIG, null)); const oauth: OauthConfigModel = Object.assign({}, this.appConfig.get<OauthConfigModel>(AppConfigValues.OAUTHCONFIG, null));
if (oauth) { if (oauth) {
@@ -57,6 +57,6 @@ export class AlfrescoApiLoaderService {
oauth2: oauth oauth2: oauth
}); });
this.apiService.load(config); await this.apiService.load(config);
} }
} }

View File

@@ -49,7 +49,7 @@ export class AlfrescoApiService {
this.currentAppConfig = config; this.currentAppConfig = config;
if (config.authType === 'OAUTH') { if (config.authType === 'OAUTH') {
this.mapAlfrescoApiOpenIdConfig(); await this.mapAlfrescoApiOpenIdConfig();
} }
this.initAlfrescoApiWithConfig(); this.initAlfrescoApiWithConfig();
@@ -59,7 +59,7 @@ export class AlfrescoApiService {
async reset() { async reset() {
this.getCurrentAppConfig(); this.getCurrentAppConfig();
if (this.currentAppConfig.authType === 'OAUTH') { if (this.currentAppConfig.authType === 'OAUTH') {
this.mapAlfrescoApiOpenIdConfig(); await this.mapAlfrescoApiOpenIdConfig();
} }
this.initAlfrescoApiWithConfig(); this.initAlfrescoApiWithConfig();
} }