diff options
Diffstat (limited to 'controllers')
| -rw-r--r-- | controllers/galleryController.js | 8 | ||||
| -rw-r--r-- | controllers/uploadController.js | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/controllers/galleryController.js b/controllers/galleryController.js index 39826dd..4fd7c49 100644 --- a/controllers/galleryController.js +++ b/controllers/galleryController.js @@ -5,8 +5,8 @@ let galleryController = {} galleryController.list = 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') db.table('gallery').select('id', 'name').then((data) => { @@ -16,8 +16,8 @@ galleryController.list = function(req, res, next){ galleryController.test = 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 testdata = [ 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) => { |