API取消对节点时钟的检查

This commit is contained in:
GoEdgeLab
2021-11-16 09:02:55 +08:00
parent cb70cae5ac
commit 9b0033dd0d
2 changed files with 0 additions and 14 deletions

View File

@@ -13,7 +13,6 @@ import (
"github.com/iwind/TeaGo/lists"
"github.com/iwind/TeaGo/maps"
"google.golang.org/grpc/metadata"
"time"
)
type UserType = string
@@ -125,12 +124,6 @@ func ValidateRequest(ctx context.Context, userTypes ...UserType) (userType UserT
return UserTypeNone, 0, 0, errors.New("decode token error: " + err.Error())
}
timestamp := m.GetInt64("timestamp")
if time.Now().Unix()-timestamp > 600 {
// 请求超过10分钟认为超时
return UserTypeNone, 0, 0, errors.New("authenticate timeout, please check your system clock")
}
t := m.GetString("type")
if len(userTypes) > 0 && !lists.ContainsString(userTypes, t) {
return UserTypeNone, 0, 0, errors.New("not supported node type: '" + t + "'")