diff --git a/common/locales/en/api-v3.json b/common/locales/en/api-v3.json index 1b0525004e..58b3746bfe 100644 --- a/common/locales/en/api-v3.json +++ b/common/locales/en/api-v3.json @@ -6,7 +6,6 @@ "missingPassword": "Missing password.", "missingNewPassword": "Missing newPassword.", "wrongPassword": "Wrong password.", - "passwordSaved": "New password has been saved.", "notAnEmail": "Invalid email address.", "emailTaken": "Email already taken.", "newEmailRequired": "The newEmail body parameter is required.", diff --git a/test/api/v3/integration/user/POST-user_update_password.test.js b/test/api/v3/integration/user/POST-user_update_password.test.js index e557655415..728abb13db 100644 --- a/test/api/v3/integration/user/POST-user_update_password.test.js +++ b/test/api/v3/integration/user/POST-user_update_password.test.js @@ -2,7 +2,6 @@ import { generateUser, translate as t, } from '../../../../helpers/api-integration/v3'; -import { model as User } from '../../../../../website/src/models/user'; describe('POST /user/update-password', async () => { let endpoint = '/user/update-password'; @@ -23,7 +22,7 @@ describe('POST /user/update-password', async () => { confirmPassword: newPassword, }); expect(response).to.eql({}); - user = await User.findOne({ _id: user._id }); + await user.sync(); expect(user.auth.local.hashed_password).to.not.eql(previousHashedPassword); }); diff --git a/website/src/controllers/api-v3/user.js b/website/src/controllers/api-v3/user.js index a8f4ecbce8..c4a68df4e9 100644 --- a/website/src/controllers/api-v3/user.js +++ b/website/src/controllers/api-v3/user.js @@ -77,7 +77,7 @@ api.updatePassword = { user.auth.local.hashed_password = passwordUtils.encrypt(req.body.newPassword, user.auth.local.salt); // eslint-disable-line camelcase await user.save(); - res.send(200, {}); + res.respond(200, {}); }, }; @@ -122,7 +122,7 @@ api.updateUsername = { user.auth.local.username = req.body.username; await user.save(); - res.send(200, { username: req.body.username }); + res.respond(200, { username: req.body.username }); }, };