From 570f6c3ce3669571b05eeb6c8ebb2ca21d641a3c Mon Sep 17 00:00:00 2001 From: kanadeko Date: Mon, 16 Jan 2017 04:45:29 -0300 Subject: Print and save tokens --- controllers/uploadController.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'controllers/uploadController.js') diff --git a/controllers/uploadController.js b/controllers/uploadController.js index 090181a..5afcc29 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -22,8 +22,8 @@ const upload = multer({ uploadsController.upload = function(req, res, next){ - if(config.TOKEN !== '') - if(req.headers.auth !== config.TOKEN) + if(config.TOKEN === true) + if(req.headers.auth !== config.clientToken) return res.status(401).send('not-authorized') let gallery = req.headers.gallery @@ -63,8 +63,8 @@ uploadsController.upload = function(req, res, next){ uploadsController.list = function(req, res){ - if(config.TOKEN !== '') - if(req.headers.auth !== config.TOKEN) + if(config.TOKEN === true) + if(req.headers.auth !== config.clientToken) return res.status(401).send('not-authorized') db.table('files').then((files) => { -- cgit v1.2.3