Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
}
Expand Down