Merge pull request #219 from geertjanvdk/feat/parse

Handle ValidationError returned by keyFunc in jwt.ParseWithClaims
This commit is contained in:
Dave Grijalva 2018-03-08 10:58:47 -08:00 committed by GitHub
commit 5cc2026634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -96,6 +96,9 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf
}
if key, err = keyFunc(token); err != nil {
// keyFunc returned an error
if ve, ok := err.(*ValidationError); ok {
return token, ve
}
return token, &ValidationError{Inner: err, Errors: ValidationErrorUnverifiable}
}