Localize error
This commit is contained in:
@ -91,6 +91,13 @@ namespace Hcs.WebApp.Controllers
|
||||
{
|
||||
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||
var user = await userManager.FindByIdAsync(userId);
|
||||
|
||||
var isPasswordCorrect = await userManager.CheckPasswordAsync(user, oldPassword);
|
||||
if (!isPasswordCorrect)
|
||||
{
|
||||
return BadRequest("Неверный текущий пароль");
|
||||
}
|
||||
|
||||
var result = await userManager.ChangePasswordAsync(user, oldPassword, newPassword);
|
||||
if (result.Succeeded)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user