Closed razor-1 closed 3 years ago
This is mostly to support claim types other than MapClaims, but may have other uses as well. Made it a public struct member instead of changing the NewWithParser signature.
MapClaims
NewWithParser
A simple example custom decoder might be:
func MyDecoder(tokenString string) (t *jwt.Token, err error) { t, err = jwt.ParseWithClaims(tokenString, &MyCustomClaims{}, func(token *jwt.Token) (interface{}, error) { return []byte("mysecretkey"), nil }) return }
Are PRs accepted here? any feedback on this? thank you
This is mostly to support claim types other than
MapClaims
, but may have other uses as well. Made it a public struct member instead of changing theNewWithParser
signature.A simple example custom decoder might be: