mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/pro#9370 check all passwords, not only the first one (#4357)
Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com>
This commit is contained in:
+14
-7
@@ -386,18 +386,25 @@ export class ConnectionFormOptionsPart extends FormPart<IConnectionFormOptionsSt
|
||||
const authPropertiesInfo = this.connectionKey ? await this.connectionInfoAuthPropertiesResource.load(this.connectionKey) : undefined;
|
||||
|
||||
const properties = await this.getConnectionAuthModelProperties(this.state.authModelId, authPropertiesInfo);
|
||||
const passwordProperty = properties.find(property => property.features.includes('password'));
|
||||
const isPasswordEmpty =
|
||||
passwordProperty &&
|
||||
(this.state.credentials?.[passwordProperty.id!] === getObjectPropertyDefaultValue(passwordProperty) ||
|
||||
!this.state.credentials?.[passwordProperty.id!]);
|
||||
const passwordProperties = properties.filter(property => property.features.includes('password'));
|
||||
|
||||
if (isCredentialsChanged(properties, this.state.credentials!)) {
|
||||
this.state.credentials = prepareDynamicProperties(properties, toJS(this.state.credentials!));
|
||||
}
|
||||
|
||||
if (isPasswordEmpty) {
|
||||
delete this.state.credentials?.[passwordProperty.id!];
|
||||
if (passwordProperties.length > 0) {
|
||||
for (const passwordProperty of passwordProperties) {
|
||||
if (!passwordProperty.id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
this.state.credentials?.[passwordProperty.id] === getObjectPropertyDefaultValue(passwordProperty) ||
|
||||
(!passwordProperty.features.includes('file') && !this.state.credentials?.[passwordProperty.id])
|
||||
) {
|
||||
delete this.state.credentials?.[passwordProperty.id];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user