summaryrefslogtreecommitdiff
path: root/src/api/endpoints/i/2fa
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/endpoints/i/2fa')
-rw-r--r--src/api/endpoints/i/2fa/done.ts4
-rw-r--r--src/api/endpoints/i/2fa/register.ts2
-rw-r--r--src/api/endpoints/i/2fa/unregister.ts6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/api/endpoints/i/2fa/done.ts b/src/api/endpoints/i/2fa/done.ts
index 0b36033bb6..0f1db73829 100644
--- a/src/api/endpoints/i/2fa/done.ts
+++ b/src/api/endpoints/i/2fa/done.ts
@@ -28,8 +28,8 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
await User.update(user._id, {
$set: {
- two_factor_secret: user.two_factor_temp_secret,
- two_factor_enabled: true
+ 'account.two_factor_secret': user.two_factor_temp_secret,
+ 'account.two_factor_enabled': true
}
});
diff --git a/src/api/endpoints/i/2fa/register.ts b/src/api/endpoints/i/2fa/register.ts
index c2b5037a29..24abfcdfc5 100644
--- a/src/api/endpoints/i/2fa/register.ts
+++ b/src/api/endpoints/i/2fa/register.ts
@@ -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.password);
+ const same = await bcrypt.compare(password, user.account.password);
if (!same) {
return rej('incorrect password');
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
}
});