auth MW refactor

This commit is contained in:
nquidox 2025-09-10 21:57:09 +03:00
parent a7530a6324
commit 0903bc55eb
7 changed files with 15 additions and 148 deletions

View file

@ -5,7 +5,6 @@ import (
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"merch-parser-api/internal/interfaces"
"merch-parser-api/internal/shared"
"net/http"
"time"
)
@ -40,18 +39,6 @@ func NewApp(deps Deps) *App {
apiRoutes.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "API is ready")
})
var excludeRoutes []shared.ExcludeRoute
for _, m := range app.modules {
if hasRoutes, ok := m.(interfaces.ModuleRoutes); ok {
hasRoutes.RegisterRoutes(apiRoutes)
excludeRoutes = append(excludeRoutes, hasRoutes.ExcludeRoutes()...)
}
}
app.routerHandler.ExcludeRoutes(excludeRoutes)
return app
}