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

Bug in logic for decoding anything other than MapClaims #458

Open
smcallis opened this issue Mar 17, 2021 · 3 comments
Open

Bug in logic for decoding anything other than MapClaims #458

smcallis opened this issue Mar 17, 2021 · 3 comments

Comments

@smcallis
Copy link

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

@Waterdrips
Copy link
Contributor

#457 this project is unmaintained, I suggest using an alternative

@niclasgeiger
Copy link

We also encountered the same issue.
This should be the code snippet explaining why this wont work: https://play.golang.org/p/Tf-JYrfmbXO

@niclasgeiger
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants