diff options
| author | kanadeko <[email protected]> | 2017-01-16 04:45:29 -0300 |
|---|---|---|
| committer | kanadeko <[email protected]> | 2017-01-16 04:45:29 -0300 |
| commit | 570f6c3ce3669571b05eeb6c8ebb2ca21d641a3c (patch) | |
| tree | 40198cf3a89191a8b29b270b1f6725842584295a /controllers/uploadController.js | |
| parent | Added generation of random token (diff) | |
| download | host.fuwn.me-570f6c3ce3669571b05eeb6c8ebb2ca21d641a3c.tar.xz host.fuwn.me-570f6c3ce3669571b05eeb6c8ebb2ca21d641a3c.zip | |
Print and save tokens
Diffstat (limited to 'controllers/uploadController.js')
| -rw-r--r-- | controllers/uploadController.js | 8 |
1 files changed, 4 insertions, 4 deletions
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) => { |