summaryrefslogtreecommitdiff
path: root/src/api/endpoints/i/change_password.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/endpoints/i/change_password.ts')
-rw-r--r--src/api/endpoints/i/change_password.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/endpoints/i/change_password.ts b/src/api/endpoints/i/change_password.ts
index 16f1a2e4ec..88fb36b1fb 100644
--- a/src/api/endpoints/i/change_password.ts
+++ b/src/api/endpoints/i/change_password.ts
@@ -22,7 +22,7 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
if (newPasswordErr) return rej('invalid new_password param');
// Compare password
- const same = await bcrypt.compare(currentPassword, user.password);
+ const same = await bcrypt.compare(currentPassword, user.account.password);
if (!same) {
return rej('incorrect password');
@@ -34,7 +34,7 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
await User.update(user._id, {
$set: {
- password: hash
+ 'account.password': hash
}
});