chore: pass authenticator errors to debug logging level

This commit is contained in:
wpetit 2023-03-09 15:13:23 +01:00
parent 5e4d9eb819
commit d6aab44bee
1 changed files with 2 additions and 5 deletions

View File

@ -29,10 +29,7 @@ func CtxUser(ctx context.Context) (*User, error) {
return user, nil
}
var (
ErrUnauthenticated = errors.New("unauthenticated")
ErrForbidden = errors.New("forbidden")
)
var ErrUnauthenticated = errors.New("unauthenticated")
type User interface {
Subject() string
@ -55,7 +52,7 @@ func Middleware(authenticators ...Authenticator) func(http.Handler) http.Handler
for _, auth := range authenticators {
user, err = auth.Authenticate(ctx, r)
if err != nil {
logger.Warn(ctx, "could not authenticate request", logger.E(errors.WithStack(err)))
logger.Debug(ctx, "could not authenticate request", logger.E(errors.WithStack(err)))
continue
}