labstack / echo

High performance, minimalist Go web framework

Home Page:https://echo.labstack.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change function signature of middleware jwt's SuccessHandler

luckycatx opened this issue · comments

commented

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.

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.

commented

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?