This commit is contained in:
Victor Piousbox
2016-03-13 14:01:53 -07:00
parent c61b10a6eb
commit 0b25720232
3 changed files with 3 additions and 5 deletions

View File

@@ -6,7 +6,6 @@
"missingPassword": "Missing password.", "missingPassword": "Missing password.",
"missingNewPassword": "Missing newPassword.", "missingNewPassword": "Missing newPassword.",
"wrongPassword": "Wrong password.", "wrongPassword": "Wrong password.",
"passwordSaved": "New password has been saved.",
"notAnEmail": "Invalid email address.", "notAnEmail": "Invalid email address.",
"emailTaken": "Email already taken.", "emailTaken": "Email already taken.",
"newEmailRequired": "The newEmail body parameter is required.", "newEmailRequired": "The newEmail body parameter is required.",

View File

@@ -2,7 +2,6 @@ import {
generateUser, generateUser,
translate as t, translate as t,
} from '../../../../helpers/api-integration/v3'; } from '../../../../helpers/api-integration/v3';
import { model as User } from '../../../../../website/src/models/user';
describe('POST /user/update-password', async () => { describe('POST /user/update-password', async () => {
let endpoint = '/user/update-password'; let endpoint = '/user/update-password';
@@ -23,7 +22,7 @@ describe('POST /user/update-password', async () => {
confirmPassword: newPassword, confirmPassword: newPassword,
}); });
expect(response).to.eql({}); expect(response).to.eql({});
user = await User.findOne({ _id: user._id }); await user.sync();
expect(user.auth.local.hashed_password).to.not.eql(previousHashedPassword); expect(user.auth.local.hashed_password).to.not.eql(previousHashedPassword);
}); });

View File

@@ -77,7 +77,7 @@ api.updatePassword = {
user.auth.local.hashed_password = passwordUtils.encrypt(req.body.newPassword, user.auth.local.salt); // eslint-disable-line camelcase user.auth.local.hashed_password = passwordUtils.encrypt(req.body.newPassword, user.auth.local.salt); // eslint-disable-line camelcase
await user.save(); await user.save();
res.send(200, {}); res.respond(200, {});
}, },
}; };
@@ -122,7 +122,7 @@ api.updateUsername = {
user.auth.local.username = req.body.username; user.auth.local.username = req.body.username;
await user.save(); await user.save();
res.send(200, { username: req.body.username }); res.respond(200, { username: req.body.username });
}, },
}; };