From 8948599bbe5e056d8946b6877d0b708021ca34e5 Mon Sep 17 00:00:00 2001 From: Nathanael DEMACON Date: Thu, 4 Jul 2024 14:42:53 +0200 Subject: [PATCH] Separate verification into its own function Signed-off-by: Nathanael DEMACON --- parser.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/parser.go b/parser.go index ecf99af..9ee885a 100644 --- a/parser.go +++ b/parser.go @@ -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