身份找不到我的用户

时间:2018-01-06 06:31:50

标签: c# asp.net-core asp.net-identity asp.net-core-2.0 identityserver4

[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在我的数据库中,但仍然无法让我的用户回来。你能告诉我错误我在做什么。

问候

0 个答案:

没有答案