feat(http): log invalid login attempts (#587)

This commit is contained in:
ze0s 2022-12-28 17:58:26 +01:00 committed by GitHub
parent 0c04c669c7
commit e6c48a5228
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 10 deletions

View file

@ -2,14 +2,14 @@ package auth
import (
"context"
"errors"
"github.com/autobrr/autobrr/internal/logger"
"github.com/rs/zerolog"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/internal/logger"
"github.com/autobrr/autobrr/internal/user"
"github.com/autobrr/autobrr/pkg/argon2id"
"github.com/pkg/errors"
"github.com/rs/zerolog"
)
type Service interface {
@ -47,7 +47,7 @@ func (s *service) Login(ctx context.Context, username, password string) (*domain
}
if u == nil {
return nil, errors.New("bad credentials")
return nil, errors.Errorf("invalid login: %s", username)
}
// compare password from request and the saved password