mirror of
https://github.com/labstack/echo.git
synced 2025-01-26 03:20:08 +02:00
31361576e8
* feat: Add a new ErrorHandlerWithContext This commit adds a new error handler, which is passed the current context, so that you can add custom redirects or even other kinds of responses. For example: ```go e.Use(middleware.JWTWithConfig(middleware.JWTConfig{ SigningKey: []byte("secret"), TokenLookup: "query:token", ErrorHandlerWithContext: func(err error, c echo.Context) error { // do stuff with context and err switch err.(type) { case jwt.ValidationError: return c.Redirect(http.StatusSeeOther, "/login") } return err }, })) ``` * chore: address golint issues