mirror of
https://github.com/wassname/talk.git
synced 2026-09-10 12:43:11 +08:00
Fixed bug with password form
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user