Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Add explanatory comment about custom claims #437

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func ExampleParseWithClaims_customClaimsType() {

// sample token is expired. override time so it parses as valid
at(time.Unix(0, 0), func() {
// A pointer to the MyCustomClaims object must be used so the JSON decoder can function properly
// See https://github.com/dgrijalva/jwt-go/issues/345
token, err := jwt.ParseWithClaims(tokenString, &MyCustomClaims{}, func(token *jwt.Token) (interface{}, error) {
return []byte("AllYourBase"), nil
})
Expand Down