mirror of https://github.com/1Panel-dev/1Panel
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
471 B
19 lines
471 B
package middleware
|
|
|
|
import (
|
|
"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"
|
|
"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()
|
|
}
|
|
}
|