fix(api): conditionally enable auth APIs based on auth configuration

This commit is contained in:
yusing
2025-09-03 16:32:05 +08:00
parent a9847b6f81
commit 3be72e5c68

View File

@@ -45,6 +45,7 @@ func NewHandler() *gin.Engine {
r.GET("/api/v1/version", apiV1.Version)
if auth.IsEnabled() {
v1Auth := r.Group("/api/v1/auth")
{
v1Auth.HEAD("/check", authApi.Check)
@@ -53,6 +54,7 @@ func NewHandler() *gin.Engine {
v1Auth.POST("/callback", authApi.Callback)
v1Auth.POST("/logout", authApi.Logout)
}
}
v1 := r.Group("/api/v1")
if auth.IsEnabled() {