File tree Expand file tree Collapse file tree
webapp/packages/plugin-connections/src/ConnectionForm/Options Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -386,18 +386,25 @@ export class ConnectionFormOptionsPart extends FormPart<IConnectionFormOptionsSt
386386 const authPropertiesInfo = this . connectionKey ? await this . connectionInfoAuthPropertiesResource . load ( this . connectionKey ) : undefined ;
387387
388388 const properties = await this . getConnectionAuthModelProperties ( this . state . authModelId , authPropertiesInfo ) ;
389- const passwordProperty = properties . find ( property => property . features . includes ( 'password' ) ) ;
390- const isPasswordEmpty =
391- passwordProperty &&
392- ( this . state . credentials ?. [ passwordProperty . id ! ] === getObjectPropertyDefaultValue ( passwordProperty ) ||
393- ! this . state . credentials ?. [ passwordProperty . id ! ] ) ;
389+ const passwordProperties = properties . filter ( property => property . features . includes ( 'password' ) ) ;
394390
395391 if ( isCredentialsChanged ( properties , this . state . credentials ! ) ) {
396392 this . state . credentials = prepareDynamicProperties ( properties , toJS ( this . state . credentials ! ) ) ;
397393 }
398394
399- if ( isPasswordEmpty ) {
400- delete this . state . credentials ?. [ passwordProperty . id ! ] ;
395+ if ( passwordProperties . length > 0 ) {
396+ for ( const passwordProperty of passwordProperties ) {
397+ if ( ! passwordProperty . id ) {
398+ continue ;
399+ }
400+
401+ if (
402+ this . state . credentials ?. [ passwordProperty . id ] === getObjectPropertyDefaultValue ( passwordProperty ) ||
403+ ( ! passwordProperty . features . includes ( 'file' ) && ! this . state . credentials ?. [ passwordProperty . id ] )
404+ ) {
405+ delete this . state . credentials ?. [ passwordProperty . id ] ;
406+ }
407+ }
401408 }
402409 }
403410
You can’t perform that action at this time.
0 commit comments