mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Fixed Password Reset action not using passed in user.
This commit is contained in:
parent
8e22837158
commit
d47b5e5785
@ -860,11 +860,11 @@ namespace Teknik.Areas.Users.Controllers
|
|||||||
User user = UserHelper.GetUser(_dbContext, username);
|
User user = UserHelper.GetUser(_dbContext, username);
|
||||||
if (user != null)
|
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 they have a recovery email, let's send a verification
|
||||||
if (!string.IsNullOrEmpty(userClaims.RecoveryEmail) && userClaims.RecoveryVerified.HasValue && userClaims.RecoveryVerified.Value)
|
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) });
|
string resetUrl = Url.SubRouteUrl("account", "User.VerifyResetPassword", new { Username = user.Username, Code = WebUtility.UrlEncode(verifyCode) });
|
||||||
UserHelper.SendResetPasswordVerification(_config, user.Username, userClaims.RecoveryEmail, resetUrl);
|
UserHelper.SendResetPasswordVerification(_config, user.Username, userClaims.RecoveryEmail, resetUrl);
|
||||||
return Json(new { result = true });
|
return Json(new { result = true });
|
||||||
|
Loading…
Reference in New Issue
Block a user