diff --git a/internal/rpc/services/service_base.go b/internal/rpc/services/service_base.go index 9c53ae86..65669160 100644 --- a/internal/rpc/services/service_base.go +++ b/internal/rpc/services/service_base.go @@ -16,7 +16,6 @@ import ( "github.com/iwind/TeaGo/lists" "github.com/iwind/TeaGo/maps" "google.golang.org/grpc/metadata" - "time" ) type BaseService struct { @@ -162,12 +161,6 @@ func (this *BaseService) ValidateNodeId(ctx context.Context, roles ...rpcutils.U return rpcutils.UserTypeNone, 0, errors.New("decode token error: " + err.Error()) } - timestamp := m.GetInt64("timestamp") - if time.Now().Unix()-timestamp > 600 { - // 请求超过10分钟认为超时 - return rpcutils.UserTypeNone, 0, errors.New("authenticate timeout, please check your system clock") - } - role = apiToken.Role switch apiToken.Role { case rpcutils.UserTypeNode: diff --git a/internal/rpc/utils/utils.go b/internal/rpc/utils/utils.go index bbe71cc9..476cb750 100644 --- a/internal/rpc/utils/utils.go +++ b/internal/rpc/utils/utils.go @@ -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 + "'")