feat(http): improve invalid login handling (#597)

* feat(http): improve invalid login handling

* fix(http): do not log password
This commit is contained in:
ze0s 2022-12-31 01:04:41 +01:00 committed by GitHub
parent 9c16c7a4a1
commit 6b1490726f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -75,7 +75,7 @@ func (h authHandler) login(w http.ResponseWriter, r *http.Request) {
_, err := h.service.Login(ctx, data.Username, data.Password)
if err != nil {
h.log.Error().Err(err).Msgf("invalid login [%s] from: %s", ReadUserIP(r))
h.log.Error().Err(err).Msgf("Auth: Failed login attempt username: [%s] ip: %s", data.Username, ReadUserIP(r))
h.encoder.StatusResponse(ctx, w, nil, http.StatusUnauthorized)
return
}