comment modification

This commit is contained in:
2019-07-13 16:11:30 +02:00
parent 8c52cc7a2e
commit be6172c8a4

View File

@ -490,9 +490,9 @@ namespace Yavsc.Controllers
_logger.LogWarning($"ForgotPassword: Email or User name {model.LoginOrEmail} not found"); _logger.LogWarning($"ForgotPassword: Email or User name {model.LoginOrEmail} not found");
return View("ForgotPasswordConfirmation"); return View("ForgotPasswordConfirmation");
} }
// user != null // We cannot require the email to be confimed,
// We want him to have a confirmed e-mail, and prevent this script // or a lot of non confirmed email never be able to finalyze
// to be used to send e-mail to any arbitrary person // registration.
if (!await _userManager.IsEmailConfirmedAsync(user)) if (!await _userManager.IsEmailConfirmedAsync(user))
{ {
_logger.LogWarning($"ForgotPassword: Email {model.LoginOrEmail} not confirmed"); _logger.LogWarning($"ForgotPassword: Email {model.LoginOrEmail} not confirmed");
@ -523,16 +523,17 @@ namespace Yavsc.Controllers
return View(); return View();
} }
//
// GET: /Account/ResetPassword // GET: /Account/ResetPassword
[HttpGet] [HttpGet]
[AllowAnonymous] [AllowAnonymous]
public IActionResult ResetPassword(string UserId, string code = null) public async Task<IActionResult> ResetPassword(string UserId, string code = null)
{ {
return code == null ? View("Error") : View(); var user = await _userManager.FindByIdAsync(UserId);
if (user==null) return new BadRequestResult();
// We just serve the form to reset here.
return View();
} }
//
// POST: /Account/ResetPassword // POST: /Account/ResetPassword
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]