Some bug fixes
This commit is contained in:
@@ -28,8 +28,8 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
|
||||
|
||||
await User.update(user._id, {
|
||||
$set: {
|
||||
'account.twoFactorSecret': user.twoFactorTempSecret,
|
||||
'account.twoFactorEnabled': true
|
||||
'twoFactorSecret': user.twoFactorTempSecret,
|
||||
'twoFactorEnabled': true
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -14,7 +14,7 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
|
||||
if (passwordErr) return rej('invalid password param');
|
||||
|
||||
// Compare password
|
||||
const same = await bcrypt.compare(password, user.account.password);
|
||||
const same = await bcrypt.compare(password, user.password);
|
||||
|
||||
if (!same) {
|
||||
return rej('incorrect password');
|
||||
|
@@ -11,7 +11,7 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
|
||||
if (passwordErr) return rej('invalid password param');
|
||||
|
||||
// Compare password
|
||||
const same = await bcrypt.compare(password, user.account.password);
|
||||
const same = await bcrypt.compare(password, user.password);
|
||||
|
||||
if (!same) {
|
||||
return rej('incorrect password');
|
||||
@@ -19,8 +19,8 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
|
||||
|
||||
await User.update(user._id, {
|
||||
$set: {
|
||||
'account.twoFactorSecret': null,
|
||||
'account.twoFactorEnabled': false
|
||||
'twoFactorSecret': null,
|
||||
'twoFactorEnabled': false
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user