fix: log same error message on api 401 as on login error to allow fail2ban blocking (#6782)

This commit is contained in:
Elian Doran 2025-08-26 08:53:55 +03:00 committed by GitHub
commit 9373d47e86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,6 +159,7 @@ function checkCredentials(req: Request, res: Response, next: NextFunction) {
if (!passwordEncryptionService.verifyPassword(password)) { if (!passwordEncryptionService.verifyPassword(password)) {
res.setHeader("Content-Type", "text/plain").status(401).send("Incorrect password"); res.setHeader("Content-Type", "text/plain").status(401).send("Incorrect password");
log.info(`WARNING: Wrong password from ${req.ip}, rejecting.`);
} else { } else {
next(); next();
} }