parent
f5dcdfd8de
commit
aba10e768b
|
|
@ -26,12 +26,12 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
protocol: scheme);
|
||||
}
|
||||
|
||||
public static string ResetPasswordCallbackLink(this IUrlHelper urlHelper, string userId, string code, string scheme)
|
||||
public static string ResetPasswordCallbackLink(this IUrlHelper urlHelper, string code, string scheme)
|
||||
{
|
||||
return urlHelper.Page(
|
||||
"/Account/ResetPassword",
|
||||
pageHandler: null,
|
||||
values: new { userId, code },
|
||||
values: new { code },
|
||||
protocol: scheme);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Company.WebApplication1.Pages.Account
|
|||
// For more information on how to enable account confirmation and password reset please
|
||||
// visit https://go.microsoft.com/fwlink/?LinkID=532713
|
||||
var code = await _userManager.GeneratePasswordResetTokenAsync(user);
|
||||
var callbackUrl = Url.ResetPasswordCallbackLink(user.Id, code, Request.Scheme);
|
||||
var callbackUrl = Url.ResetPasswordCallbackLink(code, Request.Scheme);
|
||||
await _emailSender.SendResetPasswordAsync(Input.Email, callbackUrl);
|
||||
return RedirectToPage("./ForgotPasswordConfirmation");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ namespace Company.WebApplication1.Identity.Controllers
|
|||
// For more information on how to enable account confirmation and password reset please
|
||||
// visit https://go.microsoft.com/fwlink/?LinkID=532713
|
||||
var code = await _userManager.GeneratePasswordResetTokenAsync(user);
|
||||
var callbackUrl = Url.ResetPasswordCallbackLink(user.Id, code, Request.Scheme);
|
||||
var callbackUrl = Url.ResetPasswordCallbackLink(code, Request.Scheme);
|
||||
await _emailSender.SendEmailAsync(model.Email, "Reset Password",
|
||||
$"Please reset your password by clicking here: <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>link</a>");
|
||||
return RedirectToAction(nameof(ForgotPasswordConfirmation));
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
protocol: scheme);
|
||||
}
|
||||
|
||||
public static string ResetPasswordCallbackLink(this IUrlHelper urlHelper, string userId, string code, string scheme)
|
||||
public static string ResetPasswordCallbackLink(this IUrlHelper urlHelper, string code, string scheme)
|
||||
{
|
||||
return urlHelper.Action(
|
||||
action: nameof(AccountController.ResetPassword),
|
||||
controller: "Account",
|
||||
values: new { userId, code },
|
||||
values: new { code },
|
||||
protocol: scheme);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue