Separate verification into its own function

Signed-off-by: Nathanael DEMACON <quantumsheep@users.noreply.github.com>
This commit is contained in:
Nathanael DEMACON 2024-07-04 14:42:53 +02:00
parent 62e504c281
commit 8948599bbe
No known key found for this signature in database
GPG Key ID: 173650D2D6B5D00F
1 changed files with 6 additions and 0 deletions

View File

@ -58,6 +58,12 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf
return token, err
}
return p.VerifyToken(token, parts, claims, keyFunc)
}
func (p *Parser) VerifyToken(token *Token, parts []string, claims Claims, keyFunc Keyfunc) (*Token, error) {
var err error
// Verify signing method is in the required set
if p.validMethods != nil {
var signingMethodValid = false