mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
Fix default SSO config not filled in (#3479)
This commit is contained in:
parent
928340f65b
commit
427b8737ee
@ -242,7 +242,7 @@ export class UserPreferencesService {
|
|||||||
if (this.storage.hasItem('authType')) {
|
if (this.storage.hasItem('authType')) {
|
||||||
return this.storage.getItem('authType');
|
return this.storage.getItem('authType');
|
||||||
} else {
|
} else {
|
||||||
return this.appConfig.get<string>('authType');
|
return this.appConfig.get<string>('authType', 'BASIC');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,14 +72,9 @@ export class HostSettingsComponent implements OnInit {
|
|||||||
|
|
||||||
let providerSelected = this.userPreference.providers;
|
let providerSelected = this.userPreference.providers;
|
||||||
|
|
||||||
let authType = 'BASIC';
|
|
||||||
if (this.userPreference.authType === 'OAUTH') {
|
|
||||||
authType = this.userPreference.authType;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.form = this.formBuilder.group({
|
this.form = this.formBuilder.group({
|
||||||
providersControl: [providerSelected, Validators.required],
|
providersControl: [providerSelected, Validators.required],
|
||||||
authType: authType
|
authType: this.userPreference.authType
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addFormGroups();
|
this.addFormGroups();
|
||||||
@ -132,11 +127,7 @@ export class HostSettingsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createOAuthFormGroup(): AbstractControl {
|
private createOAuthFormGroup(): AbstractControl {
|
||||||
let oAuthConfig: any = {};
|
const oAuthConfig: any = this.userPreference.oauthConfig ? this.userPreference.oauthConfig : {};
|
||||||
if (this.userPreference.authType === 'OAUTH') {
|
|
||||||
oAuthConfig = this.userPreference.oauthConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.formBuilder.group({
|
return this.formBuilder.group({
|
||||||
host: [oAuthConfig.host, [Validators.required, Validators.pattern(this.HOST_REGEX)]],
|
host: [oAuthConfig.host, [Validators.required, Validators.pattern(this.HOST_REGEX)]],
|
||||||
clientId: [oAuthConfig.clientId, Validators.required],
|
clientId: [oAuthConfig.clientId, Validators.required],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user