mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
24w06b
This commit is contained in:
parent
fea70c01d8
commit
3665bc9cfd
4 changed files with 39 additions and 282 deletions
|
|
@ -12,7 +12,7 @@ var logw = logger.Logw
|
|||
func AuthHandler(c *gin.Context, cfg *config.Config) bool {
|
||||
// 如果身份验证未启用,直接返回 true
|
||||
if !cfg.Auth {
|
||||
logw("auth PASS")
|
||||
logw("auth PASSED")
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -22,13 +22,13 @@ func AuthHandler(c *gin.Context, cfg *config.Config) bool {
|
|||
|
||||
// 验证 token
|
||||
if authToken == "" {
|
||||
logw("auth FAIL: no auth_token provided")
|
||||
logw("auth FAILED: no auth_token provided")
|
||||
return false
|
||||
}
|
||||
|
||||
isValid := authToken == cfg.AuthToken
|
||||
if !isValid {
|
||||
logw("auth FAIL: invalid auth_token")
|
||||
logw("auth FAILED: invalid auth_token: %s", authToken)
|
||||
}
|
||||
|
||||
return isValid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue