Skip to content

Commit d012115

Browse files
committed
fixed data masking in case of "account" field
1 parent 425816f commit d012115

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/authentication/logging/SensitiveDataMasker.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ function maskSensitiveData(message) {
2828
var isFieldSensitive = (sensitiveFields.indexOf(prop) > -1);
2929
if (isFieldSensitive === true) {
3030
if (jsonMsg[prop] != null || jsonMsg[prop] != undefined) {
31-
jsonMsg[prop] = new Array(jsonMsg[prop].length + 1).join('X');
31+
if(typeof jsonMsg[prop].length === 'number'){
32+
jsonMsg[prop] = new Array(jsonMsg[prop].length + 1).join('X');
33+
}else if (jsonMsg.hasOwnProperty(prop)) {
34+
jsonMsg[prop] = JSON.parse(maskSensitiveData(jsonMsg[prop]));
35+
}
3236
}
3337
} else if (jsonMsg.hasOwnProperty(prop)) {
3438
jsonMsg[prop] = JSON.parse(maskSensitiveData(jsonMsg[prop]));

0 commit comments

Comments
 (0)