v1.2.0: back: use health skip from lib

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2024-04-01 19:31:01 +02:00
commit 0ad1626bdb
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632

View file

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