From aa0309cbe6217b71e572b5cd1b08889aca68a0f0 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 23 Aug 2018 20:25:34 +0800 Subject: [PATCH] fix fix fix !!!!!! --- libs/tools/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/tools/index.js b/libs/tools/index.js index cfd7b37..7c7a322 100644 --- a/libs/tools/index.js +++ b/libs/tools/index.js @@ -45,7 +45,7 @@ const hashPassword = async (pass = '') => { const comparePassword = async (password = '', hash = '') => { if (typeof password !== 'string' || password.trim().length === 0) return false if (typeof hash !== 'string' || hash.trim().length === 0) return false - let check = new Promise((resolve, reject) => { + let check = await new Promise((resolve, reject) => { bcrypt.compare(password, hash, (err, res) => { if (err) { resolve(false)