hertz-contrib/jwt

feat: add ParseOptions field for HertzJWTMiddleware

justlorain opened this issue · 0 comments

Is your feature request related to a problem? Please describe.

Because go's json package converts numeric types to float64 when decoding, you will lose precision if you store int64 values in MapClaims.

Describe the solution you'd like

Use json.Number. golang-jwt/jwt/v4, which the jwt middleware depends on, solves this problem by enabling WithJSONNumber, so the solution is to add ParseOptions field to the HertzJWTMiddleware struct to enable the corresponding configuration. Other configurations will be supported as well.