Преглед на файлове

Fixed Password Reset action not using passed in user.

master
Teknikode преди 3 месеца
родител
ревизия
d47b5e5785
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2
    2
      Teknik/Areas/User/Controllers/UserController.cs

+ 2
- 2
Teknik/Areas/User/Controllers/UserController.cs Целия файл

@@ -860,11 +860,11 @@ namespace Teknik.Areas.Users.Controllers
User user = UserHelper.GetUser(_dbContext, username);
if (user != null)
{
IdentityUserInfo userClaims = await IdentityHelper.GetIdentityUserInfo(_config, User.Identity.Name);
IdentityUserInfo userClaims = await IdentityHelper.GetIdentityUserInfo(_config, user.Username);
// If they have a recovery email, let's send a verification
if (!string.IsNullOrEmpty(userClaims.RecoveryEmail) && userClaims.RecoveryVerified.HasValue && userClaims.RecoveryVerified.Value)
{
string verifyCode = await IdentityHelper.GeneratePasswordResetToken(_config, User.Identity.Name);
string verifyCode = await IdentityHelper.GeneratePasswordResetToken(_config, user.Username);
string resetUrl = Url.SubRouteUrl("account", "User.VerifyResetPassword", new { Username = user.Username, Code = WebUtility.UrlEncode(verifyCode) });
UserHelper.SendResetPasswordVerification(_config, user.Username, userClaims.RecoveryEmail, resetUrl);
return Json(new { result = true });

Loading…
Отказ
Запис