From 0c4e3879854669acd15ea435f2c8aada6c73810a Mon Sep 17 00:00:00 2001 From: Jacob Kopczynski Date: Mon, 26 Sep 2022 07:01:52 -0700 Subject: [PATCH] Add doc comment to ParseWithClaims (#232) --- parser.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser.go b/parser.go index 2f61a69..566491c 100644 --- a/parser.go +++ b/parser.go @@ -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 {