VAN-392: suppress PII from logistration error messages (#26629)

This commit is contained in:
Zainab Amir
2021-02-19 19:04:54 +05:00
committed by GitHub
parent ba16e05899
commit 01501335fc
2 changed files with 13 additions and 3 deletions

View File

@@ -21,7 +21,7 @@
var _fn = {
validate: {
template: _.template('<li><%- content %></li>'),
template: _.template('<li <%- suppressAttr %>><%- content %></li>'),
msg: {
email: gettext("The email address you've provided isn't formatted correctly."),
@@ -133,7 +133,8 @@
context,
content,
customMsg,
liveValidationMsg;
liveValidationMsg,
suppressAttr;
_.each(tests, function(value, key) {
if (!value) {
@@ -159,8 +160,14 @@
content = _.sprintf(_fn.validate.msg[key], context);
}
suppressAttr = '';
if (['username', 'email'].indexOf($el.attr('name')) > -1) {
suppressAttr = 'data-hj-suppress';
}
txt.push(_fn.validate.template({
content: content
content: content,
suppressAttr: suppressAttr
}));
}
});

View File

@@ -423,6 +423,9 @@
$label.addClass(indicator);
$req.addClass(indicator);
$icon.addClass(indicator + ' ' + icon);
if (['username', 'email'].indexOf($el.attr('name')) > -1) {
$tip.addClass(' data-hj-suppress');
}
$tip.text(msg);
},