mirror of
https://github.com/getAlby/lndhub.go.git
synced 2025-12-23 15:44:51 +01:00
add user id to logs as json field
This commit is contained in:
@@ -10,13 +10,13 @@ import (
|
||||
"golang.org/x/time/rate"
|
||||
)
|
||||
|
||||
func RegisterLegacyEndpoints(svc *service.LndhubService, e *echo.Echo, secured *echo.Group, securedWithStrictRateLimit *echo.Group, strictRateLimitMiddleware echo.MiddlewareFunc, adminMw echo.MiddlewareFunc) {
|
||||
func RegisterLegacyEndpoints(svc *service.LndhubService, e *echo.Echo, secured *echo.Group, securedWithStrictRateLimit *echo.Group, strictRateLimitMiddleware echo.MiddlewareFunc, adminMw echo.MiddlewareFunc, logMw echo.MiddlewareFunc) {
|
||||
// Public endpoints for account creation and authentication
|
||||
e.POST("/auth", controllers.NewAuthController(svc).Auth)
|
||||
e.POST("/auth", controllers.NewAuthController(svc).Auth, logMw)
|
||||
if svc.Config.AllowAccountCreation {
|
||||
e.POST("/create", controllers.NewCreateUserController(svc).CreateUser, strictRateLimitMiddleware, adminMw)
|
||||
e.POST("/create", controllers.NewCreateUserController(svc).CreateUser, strictRateLimitMiddleware, adminMw, logMw)
|
||||
}
|
||||
e.POST("/invoice/:user_login", controllers.NewInvoiceController(svc).Invoice, middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(rate.Limit(svc.Config.DefaultRateLimit))))
|
||||
e.POST("/invoice/:user_login", controllers.NewInvoiceController(svc).Invoice, middleware.RateLimiter(middleware.NewRateLimiterMemoryStore(rate.Limit(svc.Config.DefaultRateLimit))), logMw)
|
||||
|
||||
// Secured endpoints which require a Authorization token (JWT)
|
||||
secured.POST("/addinvoice", controllers.NewAddInvoiceController(svc).AddInvoice)
|
||||
|
||||
Reference in New Issue
Block a user