diff options
| author | Pitu <[email protected]> | 2017-01-30 04:42:15 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2017-01-30 04:42:15 -0300 |
| commit | 4a4ca06366aaadbb2bd2a6216e1bd2fb00f7af85 (patch) | |
| tree | 9fad71155173940f1ef584334b941bca1d4654a1 /controllers/tokenController.js | |
| parent | Unfucked my latest commit to this file (diff) | |
| download | host.fuwn.me-4a4ca06366aaadbb2bd2a6216e1bd2fb00f7af85.tar.xz host.fuwn.me-4a4ca06366aaadbb2bd2a6216e1bd2fb00f7af85.zip | |
Forgot it was an array
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'}) }) |