mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
24w18e
This commit is contained in:
parent
aee81ba4fd
commit
91b7cfe533
5 changed files with 23 additions and 18 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue