Skip to content

feat: add ParseOptions field for HertzJWTMiddleware #12

@justlorain

Description

@justlorain

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions