set token.Signature in ParseUnverified

This commit is contained in:
Matt Williams 2024-10-18 07:36:20 -10:00 committed by GitHub
parent 5ec246c074
commit 3de13b2acb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -193,6 +193,12 @@ func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Toke
return token, parts, newError("signing method (alg) is unspecified", ErrTokenUnverifiable)
}
// Set token signature
token.Signature, err = p.DecodeSegment(parts[2])
if err != nil {
return token, newError("could not base64 decode signature", ErrTokenMalformed, err)
}
return token, parts, nil
}