fix forgot password

If Email verification is turned off but you requested a forgot password form, it would ignore the request internally. Seems like it has been this way since the beginning
This commit is contained in:
Kukks
2020-10-17 09:25:48 +02:00
parent e3a0fe88c1
commit 2a32b05df1

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));