diff --git a/cmd/main.go b/cmd/main.go index e075df5..55d3d49 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -9,6 +9,7 @@ import ( echoSwagger "github.com/swaggo/echo-swagger" logins "gitlab.g3e.fr/h6n/users/internal" "gitlab.g3e.fr/h6n/users/lib" + "gitlab.g3e.fr/h6n/users/lib/health" "gorm.io/gorm" _ "github.com/lib/pq" @@ -58,20 +59,14 @@ func skip_auth(c echo.Context) bool { if c.Request().Method == "POST" && c.Path() == "/" { return true } - if c.Request().Method == "GET" && c.Path() == "/health" { - return true - } if len(c.Path()) > 9 && c.Path()[:9] == "/swagger/" { return true } - return false + return health.IsHealth(c) } func skip_log(c echo.Context) bool { - if c.Request().Method == "GET" && c.Path() == "/health" { - return true - } - return false + return health.IsHealth(c) } // @title Users