We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfea432 commit 0c4e387Copy full SHA for 0c4e387
1 file changed
parser.go
@@ -42,6 +42,10 @@ func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
42
return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc)
43
}
44
45
+// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default
46
+// object implementing the Claims interface. This provides default values which
47
+// can be overridden and allows a caller to use their own type, rather than
48
+// the default MapClaims implementation of Claims.
49
func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) {
50
token, parts, err := p.ParseUnverified(tokenString, claims)
51
if err != nil {
0 commit comments