mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-06 13:27:43 +08:00
feat: Modify Swagger route response for unauthenticated access (#8057)
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after -17s
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after -17s
This commit is contained in:
parent
db307732c6
commit
4dd1eb7a1e
1 changed files with 6 additions and 1 deletions
|
@ -188,7 +188,12 @@ func Routers() *gin.Engine {
|
|||
|
||||
swaggerRouter := Router.Group("1panel")
|
||||
docs.SwaggerInfo.BasePath = "/api/v1"
|
||||
swaggerRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
|
||||
swaggerRouter.GET("/swagger/*any", func(c *gin.Context) {
|
||||
if !checkSession(c) {
|
||||
handleNoRoute(c)
|
||||
return
|
||||
}
|
||||
}, ginSwagger.WrapHandler(swaggerfiles.Handler))
|
||||
PublicGroup := Router.Group("")
|
||||
{
|
||||
PublicGroup.GET("/health", func(c *gin.Context) {
|
||||
|
|
Loading…
Add table
Reference in a new issue