Skip to content

Commit

Permalink
Add doc comment to ParseWithClaims (golang-jwt#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkopczyn authored and oxisto committed Feb 21, 2023
1 parent 275038d commit 3504b4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parser.go
Expand Up @@ -42,6 +42,10 @@ func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc)
}

// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default
// object implementing the Claims interface. This provides default values which
// can be overridden and allows a caller to use their own type, rather than
// the default MapClaims implementation of Claims.
func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) {
token, parts, err := p.ParseUnverified(tokenString, claims)
if err != nil {
Expand Down

0 comments on commit 3504b4b

Please sign in to comment.