Secure all links endpoint

This commit is contained in:
Andrey Chervyakov 2021-03-13 18:10:53 +06:00
parent 5c0125a4b1
commit a70aac85e7

View file

@ -22,7 +22,7 @@ func addMiddleware(s *echo.Echo, conf *koanf.Koanf) {
s.Use(middleware.JWTWithConfig(middleware.JWTConfig{ s.Use(middleware.JWTWithConfig(middleware.JWTConfig{
Skipper: func(ctx echo.Context) bool { Skipper: func(ctx echo.Context) bool {
return ctx.Request().Method == "GET" return ctx.Request().Method == "GET" && ctx.Request().URL.Path != "/links"
}, },
SigningMethod: conf.String("jwt.method"), SigningMethod: conf.String("jwt.method"),
SigningKey: conf.Bytes("jwt.key"), SigningKey: conf.Bytes("jwt.key"),