Sample: use FindByEmailAsync in ResetPassword flow

This commit is contained in:
Jonathan Underwood 2016-12-14 14:47:33 -06:00 committed by Hao Kung
parent 5aed9742a4
commit 9e59e79a94
1 changed files with 2 additions and 2 deletions

View File

@ -270,7 +270,7 @@ namespace IdentitySample.Controllers
{ {
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
var user = await _userManager.FindByNameAsync(model.Email); var user = await _userManager.FindByEmailAsync(model.Email);
if (user == null || !(await _userManager.IsEmailConfirmedAsync(user))) if (user == null || !(await _userManager.IsEmailConfirmedAsync(user)))
{ {
// Don't reveal that the user does not exist or is not confirmed // Don't reveal that the user does not exist or is not confirmed
@ -319,7 +319,7 @@ namespace IdentitySample.Controllers
{ {
return View(model); return View(model);
} }
var user = await _userManager.FindByNameAsync(model.Email); var user = await _userManager.FindByEmailAsync(model.Email);
if (user == null) if (user == null)
{ {
// Don't reveal that the user does not exist // Don't reveal that the user does not exist