This commit is contained in:
@@ -223,6 +223,10 @@ type AuthConfig struct {
|
||||
// 所有错误统一返回 AppError,由全局 ErrorHandler 处理
|
||||
func Auth(config AuthConfig) fiber.Handler {
|
||||
return func(c *fiber.Ctx) error {
|
||||
if c.Method() == fiber.MethodOptions {
|
||||
return c.SendStatus(fiber.StatusNoContent)
|
||||
}
|
||||
|
||||
// 检查是否跳过认证
|
||||
path := c.Path()
|
||||
for _, skipPath := range config.SkipPaths {
|
||||
|
||||
Reference in New Issue
Block a user