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 /routes/api.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 'routes/api.js')
| -rw-r--r-- | routes/api.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routes/api.js b/routes/api.js index 76fc768..7f1f047 100644 --- a/routes/api.js +++ b/routes/api.js @@ -4,15 +4,15 @@ const uploadController = require('../controllers/uploadController') const galleryController = require('../controllers/galleryController') routes.get ('/check', (req, res, next) => { - if(config.TOKEN === '') + if(config.TOKEN === true) return res.json({token: false}) return res.json({token: true}) }) routes.get('/info', (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') return res.json({ |