mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 20:50:06 +00:00
🐛 修复修改服务器导致 Agent 离线
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
pb "github.com/naiba/nezha/proto"
|
||||
)
|
||||
|
||||
var Version = "v0.9.10" // !!记得修改 README 中的 badge 版本!!
|
||||
var Version = "v0.9.11" // !!记得修改 README 中的 badge 版本!!
|
||||
|
||||
var (
|
||||
Conf *model.Config
|
||||
|
||||
@@ -35,8 +35,11 @@ func (a *AuthHandler) Check(ctx context.Context) (uint64, error) {
|
||||
dao.ServerLock.RLock()
|
||||
defer dao.ServerLock.RUnlock()
|
||||
clientID, hasID := dao.SecretToID[clientSecret]
|
||||
if !hasID {
|
||||
return 0, status.Errorf(codes.Unauthenticated, "客户端认证失败")
|
||||
}
|
||||
_, hasServer := dao.ServerList[clientID]
|
||||
if !hasID || !hasServer {
|
||||
if !hasServer {
|
||||
return 0, status.Errorf(codes.Unauthenticated, "客户端认证失败")
|
||||
}
|
||||
return clientID, nil
|
||||
|
||||
Reference in New Issue
Block a user