diff --git a/backend/src/entities/table/utils/hash-passwords-in-row.util.ts b/backend/src/entities/table/utils/hash-passwords-in-row.util.ts index 64538ced9..ffeab9d11 100644 --- a/backend/src/entities/table/utils/hash-passwords-in-row.util.ts +++ b/backend/src/entities/table/utils/hash-passwords-in-row.util.ts @@ -2,6 +2,7 @@ import { TableWidgetEntity } from '../../widget/table-widget.entity.js'; import { WidgetTypeEnum } from '../../../enums/index.js'; import { IPasswordWidgetParams } from '../../widget/table-widget.interface.js'; import { Encryptor } from '../../../helpers/encryption/encryptor.js'; +import { Constants } from '../../../helpers/constants/constants.js'; import JSON5 from 'json5'; export async function hashPasswordsInRowUtil( @@ -15,6 +16,12 @@ export async function hashPasswordsInRowUtil( const widgetParams = JSON5.parse(widget.widget_params) as unknown as IPasswordWidgetParams; const fieldValue = row[widget.field_name]; + // Skip processing if the field value is the removed password placeholder + if (fieldValue === Constants.REMOVED_PASSWORD_VALUE) { + delete row[widget.field_name]; + continue; + } + if (fieldValue !== undefined && fieldValue !== null && fieldValue !== '' && widgetParams.encrypt) { row[widget.field_name] = await Encryptor.processDataWithAlgorithm(fieldValue as any, widgetParams.algorithm); }