From 3f26c76ba92701cb11c306eea8018b4c7a48e3a4 Mon Sep 17 00:00:00 2001 From: frankpagan Date: Sat, 17 Feb 2024 05:27:24 -0500 Subject: [PATCH] TODO: update authorization in send() --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index d199b4c..cbde32f 100644 --- a/src/index.js +++ b/src/index.js @@ -494,6 +494,11 @@ class SocketServer extends EventEmitter { Data = { ...data } } + // TODO: the following code can cause issues in client and improved approach is to check if user has permission and send or dont send + // if (Data.$filter && Data.$filter.query && Data.$filter.query._id && Data.$filter.query._id.$eq === '$user_id') + // delete Data.$filter.query._id + + delete Data.socket sockets[i].send(JSON.stringify(Data));