[HttpPost]
public async Task<IActionResult> ForgotPassword([FromBody] RegisterDto model)
{
var user = await _userManager.FindByEmailAsync(model.Email);
if (user == null)
return Content("Email id not exist");
var passwordResetToken = await _userManager.GeneratePasswordResetTokenAsync(user);
var passwordResetUrl = Url.Action("ResetPassword", "Account", new { id = user.Id, token = passwordResetToken }, Request.Scheme);
await _messageService.Send(model.Email, "Password reset", $"Click <a href=\"" + passwordResetUrl + "\">here</a> to reset your password");
return Content("Check your email for a password reset link");
}
我正在调试这个方法,我从邮递员传递我的电子邮件ID,电子邮件ID在我的数据库中,但仍然无法让我的用户回来。你能告诉我错误我在做什么。
问候