🔐 fix: Avoid Logging Password On Login Validation Error (#12926)

The Passport local strategy validation error logged the entire request
body (including the password) into error logs. Replace it with the
email only, matching the metadata shape used by sibling log calls in
the same function.
This commit is contained in:
Danny Avila 2026-05-03 21:27:41 -04:00 committed by GitHub
parent 5013d6d35c
commit 85fa881e3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,7 +18,7 @@ async function passportLogin(req, email, password, done) {
try {
const validationError = await validateLoginRequest(req);
if (validationError) {
logError('Passport Local Strategy - Validation Error', { reqBody: req.body });
logError('Passport Local Strategy - Validation Error', { email: req.body?.email });
logger.error(`[Login] [Login failed] [Username: ${email}] [Request-IP: ${req.ip}]`);
return done(null, false, { message: validationError });
}