From df8cac0f0be58b4d30fc5699cfb471b3249bed40 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Mon, 9 Sep 2019 01:33:07 +0700 Subject: [PATCH] Fixed some critical bugs --- controllers/authController.js | 2 +- controllers/utilsController.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/authController.js b/controllers/authController.js index da9073b..e99c128 100644 --- a/controllers/authController.js +++ b/controllers/authController.js @@ -87,7 +87,7 @@ self.register = async (req, res, next) => { permission: perms.permissions.user }) utils.invalidateStatsCache('users') - token.onHold.delete(token) + tokens.onHold.delete(token) return res.json({ success: true, token }) } catch (error) { diff --git a/controllers/utilsController.js b/controllers/utilsController.js index 6c335ee..0d55701 100644 --- a/controllers/utilsController.js +++ b/controllers/utilsController.js @@ -336,7 +336,7 @@ self.bulkDeleteFromDb = async (field, values, user) => { .whereIn(field, chunks[i]) .where(function () { if (!ismoderator) - self.where('userid', user.id) + this.where('userid', user.id) }) // Push files that could not be found in db