Return a 401 error on invalid auth tokens (#1184)

This commit is contained in:
ben-toogood 2020-02-11 11:22:22 +00:00 committed by GitHub
parent 8ea84ac3eb
commit 4a03183481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,7 +172,7 @@ func AuthHandler(fn func() auth.Auth) server.HandlerWrapper {
// Validate the token // Validate the token
if _, err := a.Validate(token); err != nil { if _, err := a.Validate(token); err != nil {
return err return errors.Unauthorized("go.micro.auth", err.Error())
} }
return h(ctx, req, rsp) return h(ctx, req, rsp)