Closed panjf2000 closed 1 year ago
The current implementation doesn't handle jwt.WithJSONNumber() parse option well, if you set this option and try to parse a JWT, it always fails type conversion here:
jwt.WithJSONNumber()
https://github.com/appleboy/gin-jwt/blob/6b68cb3e1879fc8f8936ee7a7cbb65e40e389e66/auth_jwt.go#L430-L433
We should also take care of the type json.Number and avoid the false alarm, this is also what https://github.com/golang-jwt/jwt/blob/main/map_claims.go#L40-L56 does.
json.Number
cc @appleboy
any comments on this? @appleboy
LGTM @panjf2000 Thanks.
@panjf2000 sorry for the late response.
Could you set up a new release for this?
The current implementation doesn't handle
jwt.WithJSONNumber()
parse option well, if you set this option and try to parse a JWT, it always fails type conversion here:https://github.com/appleboy/gin-jwt/blob/6b68cb3e1879fc8f8936ee7a7cbb65e40e389e66/auth_jwt.go#L430-L433
We should also take care of the type
json.Number
and avoid the false alarm, this is also what https://github.com/golang-jwt/jwt/blob/main/map_claims.go#L40-L56 does.