add verbose message for field whitelist

v1.18.x
Baris Usakli 7 years ago
parent 947fc739eb
commit aecbcd9e89

@ -78,7 +78,11 @@ module.exports = function (User) {
function (results, next) {
if (fields.length) {
fields = fields.filter(function (field) {
return field && results.whitelist.includes(field);
var isFieldWhitelisted = field && results.whitelist.includes(field);
if (!isFieldWhitelisted) {
winston.verbose('[user/getUsersFields] ' + field + ' removed because it is not whitelisted, see `filter:user.whietlistFields`');
}
return isFieldWhitelisted;
});
} else {
fields = results.whitelist;

Loading…
Cancel
Save