Skip to content

Commit 4320afa

Browse files
committed
adding no-op error
1 parent f2d12ee commit 4320afa

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

internal/jwt/errors.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,5 @@ var ErrForbidden = types.ServiceError{
132132
Title: "Access Forbidden",
133133
Detail: "You don't have the required permissions to access this resource",
134134
}
135+
136+
var ErrNoOp = types.ServiceError{}

internal/jwt/validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func (v *Validator) ParseHTTPRequest(r *http.Request) (accessToken jwt.Token, re
187187
return nil, &ErrJWTInvalidIssuer
188188
case jws.IsVerificationError(err):
189189
if v.IsOptional() {
190-
return nil, nil
190+
return nil, &ErrNoOp
191191
}
192192
panic("unable to verify jwt")
193193
case errors.Is(err, jwt.ErrInvalidJWT()):

0 commit comments

Comments
 (0)