Localize error
This commit is contained in:
@ -91,6 +91,13 @@ namespace Hcs.WebApp.Controllers
|
|||||||
{
|
{
|
||||||
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||||
var user = await userManager.FindByIdAsync(userId);
|
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);
|
var result = await userManager.ChangePasswordAsync(user, oldPassword, newPassword);
|
||||||
if (result.Succeeded)
|
if (result.Succeeded)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user