Перенести WithUser в httpx

This commit is contained in:
2026-10-06 14:49:19 +03:00
parent f42bf97b3a
commit 6720108793
6 changed files with 60 additions and 48 deletions
+2 -3
View File
@@ -6,7 +6,6 @@ import (
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"messenger/internal/auth"
"messenger/internal/platform/httpx"
)
@@ -19,10 +18,10 @@ func NewHandler(users *Service) *Handler {
}
// Register mounts registration on the public router and the current-user
// endpoint on the router guarded by RequireUser.
// endpoint on the router guarded by the authentication middleware.
func (h *Handler) Register(public, protected gin.IRouter) {
public.POST("/users", h.register)
protected.GET("/users/me", auth.WithUser(h.me))
protected.GET("/users/me", httpx.WithUser(h.me))
}
type createRequest struct {