Fixed bug with password form

This commit is contained in:
Wyatt Johnson
2018-05-07 17:47:02 -06:00
parent 926364ad72
commit 10a99aab88
4 changed files with 18 additions and 5 deletions
+6 -2
View File
@@ -1,4 +1,8 @@
const { ErrNotFound, ErrNotAuthorized } = require('../../errors');
const {
ErrNotFound,
ErrNotAuthorized,
ErrPasswordIncorrect,
} = require('../../errors');
const Users = require('../../services/users');
const migrationHelpers = require('../../services/migration/helpers');
const {
@@ -170,7 +174,7 @@ const changeUserPassword = async (ctx, oldPassword, newPassword) => {
// Verify the old password.
const validPassword = await user.verifyPassword(oldPassword);
if (!validPassword) {
throw new ErrNotAuthorized();
throw new ErrPasswordIncorrect();
}
// Change the users password now.