summaryrefslogtreecommitdiff
path: root/src/api/endpoints/i/2fa/unregister.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/endpoints/i/2fa/unregister.ts')
-rw-r--r--src/api/endpoints/i/2fa/unregister.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/endpoints/i/2fa/unregister.ts b/src/api/endpoints/i/2fa/unregister.ts
index 6bee6a26f2..c43f9ccc44 100644
--- a/src/api/endpoints/i/2fa/unregister.ts
+++ b/src/api/endpoints/i/2fa/unregister.ts
@@ -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.password);
+ const same = await bcrypt.compare(password, user.account.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: {
- two_factor_secret: null,
- two_factor_enabled: false
+ 'account.two_factor_secret': null,
+ 'account.two_factor_enabled': false
}
});