mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(http): log invalid login attempts (#587)
This commit is contained in:
parent
0c04c669c7
commit
e6c48a5228
5 changed files with 35 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue