mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fix login oauth cookie problem (#3508)
* fix login don't check the cookie in oauth2 * fix test * check boolean storage
This commit is contained in:
@@ -104,7 +104,9 @@ export class AlfrescoApiService {
|
||||
return this.getInstance().core.groupsApi;
|
||||
}
|
||||
|
||||
constructor(protected appConfig: AppConfigService, protected storage: StorageService) {}
|
||||
constructor(protected appConfig: AppConfigService,
|
||||
protected storage: StorageService) {
|
||||
}
|
||||
|
||||
async load() {
|
||||
await this.appConfig.load().then(() => {
|
||||
@@ -124,13 +126,13 @@ export class AlfrescoApiService {
|
||||
}
|
||||
|
||||
const config = {
|
||||
provider: this.appConfig.get<string>(AppConfigValues.PROVIDERS),
|
||||
provider: this.getProvider(),
|
||||
hostEcm: this.appConfig.get<string>(AppConfigValues.ECMHOST),
|
||||
hostBpm: this.appConfig.get<string>(AppConfigValues.BPMHOST),
|
||||
authType: this.appConfig.get<string>(AppConfigValues.AUTHTYPE, 'BASIC'),
|
||||
contextRootBpm: this.appConfig.get<string>(AppConfigValues.CONTEXTROOTBPM),
|
||||
contextRoot: this.appConfig.get<string>(AppConfigValues.CONTEXTROOTECM),
|
||||
disableCsrf: this.storage.getItem('DISABLE_CSRF') === 'true',
|
||||
disableCsrf: this.getDisableCSRF(),
|
||||
oauth2: oauth
|
||||
};
|
||||
|
||||
@@ -140,4 +142,18 @@ export class AlfrescoApiService {
|
||||
this.alfrescoApi = <AlfrescoApi> new alfrescoApi(config);
|
||||
}
|
||||
}
|
||||
|
||||
// @deprecated 3.0.0 get only from app config
|
||||
private getDisableCSRF(): boolean {
|
||||
if (this.storage.getItem(AppConfigValues.DISABLECSRF) === 'true') {
|
||||
return true;
|
||||
} else {
|
||||
return this.appConfig.get<boolean>(AppConfigValues.DISABLECSRF);
|
||||
}
|
||||
}
|
||||
|
||||
// @deprecated 3.0.0 get only from app config
|
||||
private getProvider() {
|
||||
return this.storage.getItem(AppConfigValues.PROVIDERS) || this.appConfig.get<string>(AppConfigValues.PROVIDERS);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user