jwt
jwt copied to clipboard
Bug in logic for decoding anything other than MapClaims
Migrated from https://github.com/dgrijalva/jwt-go/issues/458
smcallis commented on Mar 17
jwt-go/parser.go
Line 131 in dc14462 err = dec.Decode(&claims)
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
niclasgeiger commented on May 21
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
when fix it?