diff options
Diffstat (limited to 'controllers/tokenController.js')
| -rw-r--r-- | controllers/tokenController.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/controllers/tokenController.js b/controllers/tokenController.js index 6fc5c98..31b0b3d 100644 --- a/controllers/tokenController.js +++ b/controllers/tokenController.js @@ -1,5 +1,6 @@ const config = require('../config.js') const db = require('knex')(config.database) +const randomstring = require('randomstring') let tokenController = {} @@ -37,7 +38,7 @@ tokenController.change = function(req, res, next){ db.table('users').where('token', token).update({ token: newtoken, timestamp: Math.floor(Date.now() / 1000) - }).then((user) => { + }).then(() => { res.json({ success: true, token: newtoken }) }).catch(function(error) { console.log(error); res.json({success: false, description: 'error'}) }) |