Open smcallis opened 3 years ago
https://github.com/dgrijalva/jwt-go/issues/457 this project is unmaintained, I suggest using an alternative
We also encountered the same issue. This should be the code snippet explaining why this wont work: https://play.golang.org/p/Tf-JYrfmbXO
ah, if you use &MapClaims{} instead of MapClaims{} it will work. See https://stackoverflow.com/questions/50564341/pointer-to-an-interface-vs-interface-holding-a-pointer-when-unmarshaling-json for more explanations
https://github.com/dgrijalva/jwt-go/blob/dc14462fd58732591c7fa58cc8496d6824316a82/parser.go#L131
Since this function takes claims as Claims, if you pass anything other than MapClaims{}, you'll get an unmarshalling error:
Error verifying token: json: cannot unmarshal object into Go value of type jwt.Claims