labstack / echo

High performance, minimalist Go web framework
https://echo.labstack.com
MIT License
29.01k stars 2.21k forks source link

Change function signature of middleware jwt's SuccessHandler #2644

Open luckycatx opened 1 month ago

luckycatx commented 1 month ago

Should change middleware jwt's SuccessHandler:

type JWTSuccessHandler func(c echo.Context)
-> type JWTSuccessHandler func(c echo.Context) error

It should be a minor change that will not affect most uses and API.

aldas commented 1 month ago

We have marked JWT middleware as deprecated in Echo core library and avoid changing it unless there are security or other very serious issues. Successor for JWT middleware is https://github.com/labstack/echo-jwt

it has same signature as mentioned here https://github.com/labstack/echo-jwt/blob/60df66b4c5f07aec26b2a0f3d88bff9e59bbec82/jwt.go#L25 so it would be better if issue is raised there. As we have opted to have more "relaxed" versioning there and that change is more like to be implemented there than in core.

luckycatx commented 4 weeks ago

We have marked JWT middleware as deprecated in Echo core library and avoid changing it unless there are security or other very serious issues. Successor for JWT middleware is https://github.com/labstack/echo-jwt

it has same signature as mentioned here https://github.com/labstack/echo-jwt/blob/60df66b4c5f07aec26b2a0f3d88bff9e59bbec82/jwt.go#L25 so it would be better if issue is raised there. As we have opted to have more "relaxed" versioning there and that change is more like to be implemented there than in core.

I'm referring to this one, I'll open this issue there. btw is there any particular reason why the echo-jwt middleware is not put in echo-contrib repo but in a separate repo? Putting it in contrib should provide better consistency. Also, are there any plans to remove the jwt middleware in the core library?