fix(login): send back 401 Unauthorized on failed login attempt

This commit is contained in:
Panagiotis Papadopoulos 2025-04-15 08:37:10 +02:00 committed by Panagiotis Papadopoulos
parent 3a3f5be7be
commit fa350e13f6

View File

@ -134,7 +134,7 @@ function sendLoginError(req: Request, res: Response, errorType: 'password' | 'to
log.info(`WARNING: Wrong password from ${req.ip}, rejecting.`);
}
res.render('login', {
res.status(401).render('login', {
wrongPassword: errorType === 'password',
wrongTotp: errorType === 'totp',
totpEnabled: totp.isTotpEnabled(),