Closed benjaminmordaunt closed 3 years ago
This is not a bug in this library. If you're having a similar problem, you need to implement your own Valid method, similar to follows:
func (c *CustomConstraints) Valid() error {
if c.StandardClaims == nil {
return nil
}
return c.StandardClaims.Valid()
}
ParseFromRequestWithClaims seems to panic when supplied with a token with no
exp
claim. I'm using a custom claims structure which includes*jwt.StandardClaims
and an integer.When a token has its
ExpiresAt
claim set, it is parsed fine by the restricted endpoint. But if this is not set (doesn't expire), ParseWIthClaims panics for some reason and I can't figure out why.