Hi Joseph, thanks for your question.
TLDR
I modified the API. Please refresh your clone/fork. To invalidate your token, you can do something like this:
//Issue the tokentoken.Claims.Set("valid",true)token.Sign("secret")//Invalidate the tokentoken.Claims.Set("valid",false)token.Sign("secret")//Check if validverifyErr:=token.Verify(base64JWT,"secret")ifverifyErr!=nil{//Tampered token}valid,err:=token.Claims.GetBool("valid")iferr!=nil{//Error getting claim}if!valid{//Invalid token logic goes here}
Long Story:
I wrote this package a couple of years ago while learning about JWT. I open-sourced the code. However, I made a mistake and used map[string]string instead of map[string]interface{}. Thanks your question, I realized that I had made a mistake. I updated the API to include some helper functions for bool, time, []byte, string, and numbers. I really appreciate your input. I will start thinking about its first release soon. Do let me know if you have more questions. That might lead to more features on the first release. Thanks!
Hi, awsome.
Let me give it a try. Btw, how do you manage the invalidation of the tokens?
Hi Joseph, thanks for your question.
TLDR
I modified the API. Please refresh your clone/fork. To invalidate your token, you can do something like this:
Long Story:
I wrote this package a couple of years ago while learning about JWT. I open-sourced the code. However, I made a mistake and used map[string]string instead of map[string]interface{}. Thanks your question, I realized that I had made a mistake. I updated the API to include some helper functions for bool, time, []byte, string, and numbers. I really appreciate your input. I will start thinking about its first release soon. Do let me know if you have more questions. That might lead to more features on the first release. Thanks!
Great, let check it. I will tell you soon :D