chore: pass authenticator errors to debug logging level
This commit is contained in:
parent
5e4d9eb819
commit
d6aab44bee
|
@ -29,10 +29,7 @@ func CtxUser(ctx context.Context) (*User, error) {
|
||||||
return user, nil
|
return user, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var ErrUnauthenticated = errors.New("unauthenticated")
|
||||||
ErrUnauthenticated = errors.New("unauthenticated")
|
|
||||||
ErrForbidden = errors.New("forbidden")
|
|
||||||
)
|
|
||||||
|
|
||||||
type User interface {
|
type User interface {
|
||||||
Subject() string
|
Subject() string
|
||||||
|
@ -55,7 +52,7 @@ func Middleware(authenticators ...Authenticator) func(http.Handler) http.Handler
|
||||||
for _, auth := range authenticators {
|
for _, auth := range authenticators {
|
||||||
user, err = auth.Authenticate(ctx, r)
|
user, err = auth.Authenticate(ctx, r)
|
||||||
if err != nil {
|
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
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue