This commit is contained in:
WJQSERVER 2024-10-20 18:16:30 +08:00
parent aee81ba4fd
commit 91b7cfe533
5 changed files with 23 additions and 18 deletions

View file

@ -11,7 +11,7 @@ import (
var (
logw = logger.Logw
logInfo = logger.LogInfo
LogWarning = logger.LogWarning
logWarning = logger.LogWarning
logError = logger.LogError
)
@ -38,13 +38,13 @@ func AuthHandler(c *gin.Context, cfg *config.Config) bool {
// 验证 token
if authToken == "" {
LogWarning("auth FAILED: no auth_token provided")
logWarning("auth FAILED: no auth_token provided")
return false
}
isValid := authToken == cfg.Auth.AuthToken
if !isValid {
LogWarning("auth FAILED: invalid auth_token: %s", authToken)
logWarning("auth FAILED: invalid auth_token: %s", authToken)
}
logInfo("auth SUCCESS: %t", isValid)