diff --git a/chaoscenter/authentication/api/handlers/grpc/grpc_handler.go b/chaoscenter/authentication/api/handlers/grpc/grpc_handler.go index 0d104cba6f0..231e9f28a29 100644 --- a/chaoscenter/authentication/api/handlers/grpc/grpc_handler.go +++ b/chaoscenter/authentication/api/handlers/grpc/grpc_handler.go @@ -20,6 +20,11 @@ func (s *ServerGrpc) ValidateRequest(ctx context.Context, return &protos.ValidationResponse{Error: err.Error(), IsValid: false}, err } claims := token.Claims.(jwt.MapClaims) + + if claims["uid"] == nil { + return &protos.ValidationResponse{Error: "token is invalid", IsValid: false}, err + } + uid := claims["uid"].(string) err = validations.RbacValidator(uid, inputRequest.ProjectId, inputRequest.RequiredRoles, inputRequest.Invitation, s.ApplicationService)