feat: middlewares for authorization and automatic request parsing;
feat: roles enum
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user