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 --- routes/api.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'routes') 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({ -- cgit v1.2.3