Fixed some logic when signature is invalid
@@ -124,9 +124,15 @@ func (jp *Parser) Parse(tokenString string) (*jwt.Token, error) {
})
if err != nil {
+ if err == ErrSigningMethodMismatch {
continue
}
+ if validationErr, ok := err.(jwt.ValidationError); ok && validationErr.Errors&jwt.ValidationErrorSignatureInvalid != 0 {
+ continue
+ }
+ }
+
return token, err
}
