2022-09-15 09:15:03 +00:00
|
|
|
package middleware
|
|
|
|
|
|
|
|
import (
|
2022-10-17 08:32:31 +00:00
|
|
|
"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/app/service"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
2022-09-15 09:15:03 +00:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
func SafetyAuth() gin.HandlerFunc {
|
|
|
|
return func(c *gin.Context) {
|
|
|
|
if err := service.NewIAuthService().SafetyStatus(c); err != nil {
|
|
|
|
helper.ErrorWithDetail(c, constant.CodeErrUnSafety, constant.ErrTypeNotSafety, nil)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
c.Next()
|
|
|
|
}
|
|
|
|
}
|