diff --git a/backend/middleware/auth.go b/backend/middleware/auth.go index bcf1ac0bc..cf0ab8150 100644 --- a/backend/middleware/auth.go +++ b/backend/middleware/auth.go @@ -17,19 +17,6 @@ import ( "github.com/gofiber/fiber/v2/middleware/limiter" ) -// func getExcludedPaths() []map[string]string { -// return []map[string]string{ -// {"/api/v1/users/": "POST"}, -// {"/api/v1/auth/login": "POST"}, -// {"/api/v1/auth/logout": "POST"}, -// {"/api/v1/auth/refresh": "POST"}, -// {"/api/v1/auth/send-code/": "POST"}, -// {"/api/v1/auth/verify-email": "POST"}, -// {"/api/v1/auth/verify-reset": "POST"}, -// {"/api/v1/auth/forgot-password": "POST"}, -// } -// } - func (m *AuthMiddlewareService) IsSuper(c *fiber.Ctx) bool { claims, err := auth.From(c) if err != nil { @@ -57,22 +44,6 @@ func GetAuthroizationToken(c *fiber.Ctx) *string { } func (m *AuthMiddlewareService) Authenticate(c *fiber.Ctx) error { - // for _, excludedPath := range getExcludedPaths() { - // for path, method := range excludedPath { - // if c.Path() == path && c.Method() == method { - // return c.Next() - // } - // } - // } - - // if c.Method() == "OPTIONS" { - // return c.Next() - // } - // if a get request but not /api/v1/users/ or /api/v1/users/me - // if c.Method() == "GET" && c.Path() != "/api/v1/users/" && c.Path() != "/api/v1/users/me" { - // return c.Next() - // } - accessToken := GetAuthroizationToken(c) if accessToken == nil { return errors.Unauthorized.FiberError(c) diff --git a/backend/server/server.go b/backend/server/server.go index 1ec26fd12..c0bf0727c 100644 --- a/backend/server/server.go +++ b/backend/server/server.go @@ -50,7 +50,6 @@ func Init(db *gorm.DB, integrations integrations.Integrations, settings config.S authMiddleware := middleware.NewAuthAuthMiddlewareService(db, validate, settings.Auth) apiv1 := app.Group("/api/v1") - // apiv1.Use(authMiddleware.Authenticate) routeParams := types.RouteParams{ Router: apiv1,