From bdfd512c10986a9b4f137e668be6bd80dbd8f617 Mon Sep 17 00:00:00 2001 From: pitu Date: Tue, 17 Jan 2017 00:37:54 -0300 Subject: token handling and verification --- controllers/uploadController.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'controllers/uploadController.js') diff --git a/controllers/uploadController.js b/controllers/uploadController.js index a374137..c9959fb 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -22,7 +22,7 @@ const upload = multer({ uploadsController.upload = function(req, res, next){ - if(config.TOKEN === true) + if(config.private === true) if(req.headers.auth !== config.clientToken) return res.status(401).send('not-authorized') @@ -70,9 +70,8 @@ uploadsController.upload = function(req, res, next){ uploadsController.list = function(req, res){ - if(config.TOKEN === true) - if(req.headers.auth !== config.clientToken) - return res.status(401).send('not-authorized') + if(req.headers.auth !== config.adminToken) + return res.status(401).send('not-authorized') db.table('files').then((files) => { -- cgit v1.2.3