summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/i/2fa
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/endpoints/i/2fa')
-rw-r--r--src/server/api/endpoints/i/2fa/done.ts4
-rw-r--r--src/server/api/endpoints/i/2fa/register.ts2
-rw-r--r--src/server/api/endpoints/i/2fa/unregister.ts6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/server/api/endpoints/i/2fa/done.ts b/src/server/api/endpoints/i/2fa/done.ts
index 0b2e32c13f..3e824feffd 100644
--- a/src/server/api/endpoints/i/2fa/done.ts
+++ b/src/server/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: {
- 'account.twoFactorSecret': user.twoFactorTempSecret,
- 'account.twoFactorEnabled': true
+ 'twoFactorSecret': user.twoFactorTempSecret,
+ 'twoFactorEnabled': true
}
});
diff --git a/src/server/api/endpoints/i/2fa/register.ts b/src/server/api/endpoints/i/2fa/register.ts
index dc7fb959bb..bed64a2545 100644
--- a/src/server/api/endpoints/i/2fa/register.ts
+++ b/src/server/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.account.password);
+ const same = await bcrypt.compare(password, user.password);
if (!same) {
return rej('incorrect password');
diff --git a/src/server/api/endpoints/i/2fa/unregister.ts b/src/server/api/endpoints/i/2fa/unregister.ts
index ff2a435fee..f9d7a25f53 100644
--- a/src/server/api/endpoints/i/2fa/unregister.ts
+++ b/src/server/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.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
}
});