Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(public appConfig: AppConfigService, public storageService: StorageService) {
super(null, null);
const oauth = Object.assign({}, this.appConfig.get(AppConfigValues.OAUTHCONFIG, null));
this.storageService.prefix = this.appConfig.get(AppConfigValues.STORAGE_PREFIX, '');
this.config = new AlfrescoApiConfig({
provider: this.appConfig.get(AppConfigValues.PROVIDERS),
hostEcm: this.appConfig.get(AppConfigValues.ECMHOST),
hostBpm: this.appConfig.get(AppConfigValues.BPMHOST),
authType: this.appConfig.get(AppConfigValues.AUTHTYPE, 'BASIC'),
contextRootBpm: this.appConfig.get(AppConfigValues.CONTEXTROOTBPM),
contextRoot: this.appConfig.get(AppConfigValues.CONTEXTROOTECM),
disableCsrf: this.appConfig.get(AppConfigValues.DISABLECSRF),
withCredentials: this.appConfig.get(AppConfigValues.AUTH_WITH_CREDENTIALS, false),
domainPrefix: this.storageService.prefix,
oauth2: oauth
});
}
protected initAlfrescoApi() {
const 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 || '/');
}
const config = new AlfrescoApiConfig({
provider: this.appConfig.get(AppConfigValues.PROVIDERS),
hostEcm: this.appConfig.get(AppConfigValues.ECMHOST),
hostBpm: this.appConfig.get(AppConfigValues.BPMHOST),
authType: this.appConfig.get(AppConfigValues.AUTHTYPE, 'BASIC'),
contextRootBpm: this.appConfig.get(AppConfigValues.CONTEXTROOTBPM),
contextRoot: this.appConfig.get(AppConfigValues.CONTEXTROOTECM),
disableCsrf: this.appConfig.get(AppConfigValues.DISABLECSRF),
withCredentials: this.appConfig.get(AppConfigValues.AUTH_WITH_CREDENTIALS, false),
domainPrefix : this.appConfig.get(AppConfigValues.STORAGE_PREFIX),
oauth2: oauth
});
if (this.alfrescoApi && this.isDifferentConfig(this.lastConfig, config)) {
this.lastConfig = config;
this.alfrescoApi.configureJsApi(config);
} else {