Sample: use FindByEmailAsync in ResetPassword flow
This commit is contained in:
parent
5aed9742a4
commit
9e59e79a94
|
|
@ -270,7 +270,7 @@ namespace IdentitySample.Controllers
|
|||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
var user = await _userManager.FindByNameAsync(model.Email);
|
||||
var user = await _userManager.FindByEmailAsync(model.Email);
|
||||
if (user == null || !(await _userManager.IsEmailConfirmedAsync(user)))
|
||||
{
|
||||
// Don't reveal that the user does not exist or is not confirmed
|
||||
|
|
@ -319,7 +319,7 @@ namespace IdentitySample.Controllers
|
|||
{
|
||||
return View(model);
|
||||
}
|
||||
var user = await _userManager.FindByNameAsync(model.Email);
|
||||
var user = await _userManager.FindByEmailAsync(model.Email);
|
||||
if (user == null)
|
||||
{
|
||||
// Don't reveal that the user does not exist
|
||||
|
|
|
|||
Loading…
Reference in New Issue