feat: middlewares for authorization and automatic request parsing;

feat: roles enum
This commit is contained in:
2025-06-24 13:57:39 +03:00
parent be9aee7145
commit c2059dcd6e
7 changed files with 123 additions and 26 deletions

View File

@@ -18,7 +18,6 @@
package controllers
import (
"easywish/internal/middleware"
"net/http"
"github.com/gin-gonic/gin"
@@ -92,11 +91,4 @@ func (p *profileControllerImpl) UpdatePrivacySettings(c *gin.Context) {
}
func (p *profileControllerImpl) RegisterRoutes(group *gin.RouterGroup) {
protected := group.Group("")
protected.Use(middleware.JWTAuthMiddleware())
{
protected.GET("/me", p.GetOwnProfile)
protected.GET("/:username", p.GetProfile)
protected.GET("/privacy", p.GetPrivacySettings)
}
}