mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 01:08:31 +02:00
fix(api): conditionally enable auth APIs based on auth configuration
This commit is contained in:
@@ -45,13 +45,15 @@ func NewHandler() *gin.Engine {
|
|||||||
|
|
||||||
r.GET("/api/v1/version", apiV1.Version)
|
r.GET("/api/v1/version", apiV1.Version)
|
||||||
|
|
||||||
v1Auth := r.Group("/api/v1/auth")
|
if auth.IsEnabled() {
|
||||||
{
|
v1Auth := r.Group("/api/v1/auth")
|
||||||
v1Auth.HEAD("/check", authApi.Check)
|
{
|
||||||
v1Auth.POST("/login", authApi.Login)
|
v1Auth.HEAD("/check", authApi.Check)
|
||||||
v1Auth.GET("/callback", authApi.Callback)
|
v1Auth.POST("/login", authApi.Login)
|
||||||
v1Auth.POST("/callback", authApi.Callback)
|
v1Auth.GET("/callback", authApi.Callback)
|
||||||
v1Auth.POST("/logout", authApi.Logout)
|
v1Auth.POST("/callback", authApi.Callback)
|
||||||
|
v1Auth.POST("/logout", authApi.Logout)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
v1 := r.Group("/api/v1")
|
v1 := r.Group("/api/v1")
|
||||||
|
|||||||
Reference in New Issue
Block a user