Перенести WithUser в httpx
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user