From c888f086636e337267ec0f5fb27d1d80633a7364 Mon Sep 17 00:00:00 2001 From: Birm Date: Fri, 3 May 2024 14:28:26 -0400 Subject: [PATCH] in case token passed through url --- handlers/dataHandlers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/handlers/dataHandlers.js b/handlers/dataHandlers.js index c1c078e..f14c2b1 100644 --- a/handlers/dataHandlers.js +++ b/handlers/dataHandlers.js @@ -6,6 +6,7 @@ var General = {}; General.find = function(db, collection) { return function(req, res, next) { var query = req.query; + delete query.token; mongoDB.find(db, collection, query).then((x) => { req.data = x; next(); @@ -16,6 +17,7 @@ General.find = function(db, collection) { General.paginatedFind = function(db, collection) { return function(req, res, next) { var query = req.query; + delete query.token; mongoDB.paginatedFind(db, collection, query).then((x) => { req.data = x; next(); @@ -348,6 +350,7 @@ Mark.updateMarksLabel = function(req, res, next) { Mark.pointList = function(req, res, next) { var query = req.query; + delete query.token; mongoDB.find("camic", 'mark', query, { x: 1, y: 1, _id: 0 }).toArray().then((points) => { req.data = { points: points.map(point => [point.x, point.y]) }; next();