Open
Description
Migrated from dgrijalva/jwt-go#441:
Comments
@gardc
gardc commented on Nov 21, 2020 •Referring to this example (https://godoc.org/github.com/dgrijalva/jwt-go#example-Parse--Hmac) pointed to by the readme, feeding it an invalid JWT will create a memory panic.
Go playground example. (https://play.golang.org/p/wyOgm21FYE8)
Checking for err and token.Valid before assuming it's all good in the hood fixes the issue, Go playground example. (https://play.golang.org/p/0sX-54gXfE2)