4 * Scrub credential from POST login body data.
6 * @param {Boolean} sanitize
9 function sanitizePostCredential(data
, sanitize
= true) {
12 const credentialLength
= data
&& data
.ctx
&& data
.ctx
.parsedBody
&& data
.ctx
.parsedBody
.credential
&& data
.ctx
.parsedBody
.credential
.length
;
13 if (credentialLength
) {
16 if (unclean
&& sanitize
) {
17 data
.ctx
.parsedBody
.credential
= '*'.repeat(credentialLength
);
24 sanitizePostCredential
,