bugs & features

This commit is contained in:
Paul Schneider 2017-10-02 04:43:20 +02:00
commit 3fe818b4f1
21 changed files with 5512 additions and 33 deletions

View file

@ -423,17 +423,19 @@ namespace Yavsc.Controllers
{
if (ModelState.IsValid)
{
var user = await _userManager.FindByEmailAsync(model.LoginOrEmail);
ApplicationUser user;
if (model.LoginOrEmail.Contains('@')) {
user = await _userManager.FindByEmailAsync(model.LoginOrEmail);
}
else {
user = await _userManager.FindByNameAsync(model.LoginOrEmail);
}
// Don't reveal that the user does not exist or is not confirmed
if (user == null)
{
user = await _userManager.FindByNameAsync(model.LoginOrEmail);
if (user == null)
{
_logger.LogWarning($"ForgotPassword: Email or User name {model.LoginOrEmail} not found");
return View("ForgotPasswordConfirmation");
}
_logger.LogWarning($"ForgotPassword: Email or User name {model.LoginOrEmail} not found");
return View("ForgotPasswordConfirmation");
}
// user != null
// We want him to have a confirmed e-mail, and prevent this script