diff --git a/src/users/users.service.ts b/src/users/users.service.ts index eb3f4bf..12021be 100644 --- a/src/users/users.service.ts +++ b/src/users/users.service.ts @@ -248,7 +248,10 @@ export class UserService { throw new BadRequestException('Запрещено менять пароль пользователя admin'); } const user = await this.userModel().findOne({login}); - if (user && await this.checkPassword(old_password, user.password)) { + if (!await this.checkPassword(old_password, user.password)) { + throw new BadRequestException('Не верный старый пароль'); + } + if (user) { const salt = user.salt; const password = await bcrypt.hash(new_password, salt); await user.updateOne({