fix: use constant time in user checks (#1004)

This commit is contained in:
Stavros
2026-07-14 16:49:59 +03:00
committed by GitHub
parent d946926c36
commit c22925c2fb
6 changed files with 33 additions and 5 deletions
+1
View File
@@ -90,6 +90,7 @@ func (controller *UserController) loginHandler(c *gin.Context) {
if err != nil {
if errors.Is(err, service.ErrUserNotFound) {
controller.auth.DummyPasswordCheck(req.Password)
controller.log.App.Warn().Str("username", req.Username).Msg("User not found during login attempt")
controller.auth.RecordLoginAttempt(req.Username, false)
controller.log.AuditLoginFailure(req.Username, "unknown", c.ClientIP(), "user not found")