[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
Hello,
I have the invalid code on the forgot password procedure. In the razor pages scaffolding template i have:
the ForgotPassword razor page
// 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.Page(
"/Account/ResetPassword",
pageHandler: null,
values: new { code },
protocol: Request.Scheme);
await _emailSender.SendEmailAsync(
Input.Email,
"Reset Password",
$"PEr eseguire il reset della password <a href='{ HtmlEncoder.Default.Encode(callbackUrl)}'>seguire questo link</a>.");
return RedirectToPage("./ForgotPasswordConfirmation");
It encode the token but when the token arrive on the ResetPassword razor page it dosent decode as well:
public IActionResult OnGet(string code = null)
{
if (code == null)
{
return BadRequest("A code must be supplied for password reset.");
}
else
{
Input = new InputModel
{
Code = code
};
return Page();
}
}
Hello, I have the invalid code on the forgot password procedure. In the razor pages scaffolding template i have:
the
ForgotPassword
razor pageIt encode the token but when the token arrive on the
ResetPassword
razor page it dosent decode as well:So they are different.