diff --git a/lib/core/services/alfresco-api.service.ts b/lib/core/services/alfresco-api.service.ts index ad51e2aab3..fc5a536aae 100644 --- a/lib/core/services/alfresco-api.service.ts +++ b/lib/core/services/alfresco-api.service.ts @@ -117,8 +117,7 @@ export class AlfrescoApiService { } protected initAlfrescoApi() { - let oauth: OauthConfigModel = this.appConfig.get(AppConfigValues.OAUTHCONFIG, null); - + let oauth: OauthConfigModel = Object.assign({}, this.appConfig.get(AppConfigValues.OAUTHCONFIG, null)); if (oauth) { oauth.redirectUri = window.location.origin + (oauth.redirectUri || '/'); oauth.redirectUriLogout = window.location.origin + (oauth.redirectUriLogout || '/'); @@ -130,7 +129,7 @@ export class AlfrescoApiService { ticketBpm: this.storage.getItem('ticket-BPM'), hostEcm: this.appConfig.get(AppConfigValues.ECMHOST), hostBpm: this.appConfig.get(AppConfigValues.BPMHOST), - authType: this.appConfig.get(AppConfigValues.AUTHTYPE), + authType: this.appConfig.get(AppConfigValues.AUTHTYPE, 'BASIC'), contextRootBpm: this.appConfig.get(AppConfigValues.CONTEXTROOTBPM), contextRoot: this.appConfig.get(AppConfigValues.CONTEXTROOTECM), disableCsrf: this.storage.getItem('DISABLE_CSRF') === 'true', diff --git a/lib/core/settings/host-settings.component.ts b/lib/core/settings/host-settings.component.ts index 0361e2e682..4bd307a8cc 100644 --- a/lib/core/settings/host-settings.component.ts +++ b/lib/core/settings/host-settings.component.ts @@ -79,14 +79,16 @@ export class HostSettingsComponent implements OnInit { let providerSelected = this.appConfig.get(AppConfigValues.PROVIDERS); + const authType = this.appConfig.get(AppConfigValues.AUTHTYPE, 'BASIC'); + this.form = this.formBuilder.group({ providersControl: [providerSelected, Validators.required], - authType: this.appConfig.get(AppConfigValues.AUTHTYPE) + authType: authType }); this.addFormGroups(); - if (this.appConfig.get(AppConfigValues.AUTHTYPE) === 'OAUTH') { + if (authType === 'OAUTH') { this.addOAuthFormGroup(); }