From 8f4e999e437935309a8ee55e70230d99224be02d Mon Sep 17 00:00:00 2001 From: nquidox Date: Sun, 14 Sep 2025 16:22:53 +0300 Subject: [PATCH] routes change --- internal/api/user/controller.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/api/user/controller.go b/internal/api/user/controller.go index 2b88dff..d247711 100644 --- a/internal/api/user/controller.go +++ b/internal/api/user/controller.go @@ -26,14 +26,14 @@ func newController(service *service, utils interfaces.Utils) *controller { func (h *Handler) RegisterRoutes(r *gin.RouterGroup, authMW gin.HandlerFunc) { userGroup := r.Group("/user") - userGroup.POST("/", authMW, h.controller.register) + userGroup.POST("/", h.controller.register) userGroup.GET("/", authMW, h.controller.get) userGroup.PUT("/", authMW, h.controller.update) userGroup.DELETE("/", authMW, h.controller.delete) //auth h.controller.authPath = fmt.Sprintf("%s/user/auth", h.apiPrefix) - authGroup := userGroup.Group("/auth") + authGroup := r.Group("/user/auth") authGroup.POST("/login", h.controller.login) authGroup.POST("/logout", h.controller.logout) @@ -195,7 +195,6 @@ func (co *controller) login(c *gin.Context) { // @Summary Логаут // @Description Логаут. Для логаута надо передать refresh token, он будет инвалидирован. // @Tags Users - auth -// @Security BearerAuth // @Success 200 // @Failure 400 {object} responses.ErrorResponse400 // @Failure 500 {object} responses.ErrorResponse500 @@ -220,9 +219,8 @@ func (co *controller) logout(c *gin.Context) { } // @Summary Обновление аксесс токена по рефреш токену. -// @Description Принимает рефреш токен в заголовке Authorization +// @Description Принимает рефреш токен в http only куки // @Tags Users - auth -// @Security BearerAuth // @Success 200 {object} LoginResponse // @Failure 400 {object} responses.ErrorResponse400 // @Failure 500 {object} responses.ErrorResponse500