Merge pull request #1994 from btcpayserver/forgotpassword

fix forgot password
This commit is contained in:
Nicolas Dorier
2020-10-18 11:54:55 +09:00
committed by GitHub

View File

@@ -537,7 +537,7 @@ namespace BTCPayServer.Controllers
if (ModelState.IsValid)
{
var user = await _userManager.FindByEmailAsync(model.Email);
if (user == null || !(await _userManager.IsEmailConfirmedAsync(user)))
if (user == null || (user.RequiresEmailConfirmation && !(await _userManager.IsEmailConfirmedAsync(user))))
{
// Don't reveal that the user does not exist or is not confirmed
return RedirectToAction(nameof(ForgotPasswordConfirmation));