Skip to content

Commit

Permalink
Update AccountController.cs (#14054)
Browse files Browse the repository at this point in the history
  • Loading branch information
allanchua101 authored and guardrex committed Aug 28, 2019
1 parent 4087024 commit 4b9e18d
Showing 1 changed file with 7 additions and 6 deletions.
Expand Up @@ -59,8 +59,9 @@ public async Task<IActionResult> Login(LoginViewModel model, string returnUrl =
ViewData["ReturnUrl"] = returnUrl;
if (ModelState.IsValid)
{
// This doesn't count login failures towards account lockout
// To enable password failures to trigger account lockout, set lockoutOnFailure: true
// This does not count login failures towards account lockout
// To enable password failures to trigger account lockout,
// set lockoutOnFailure: true
var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false);
if (result.Succeeded)
{
Expand All @@ -83,15 +84,15 @@ public async Task<IActionResult> Login(LoginViewModel model, string returnUrl =
}
}

// If we got this far, something failed, redisplay form
// If execution got this far, something failed, redisplay the form.
return View(model);
}

[HttpGet]
[AllowAnonymous]
public async Task<IActionResult> LoginWith2fa(bool rememberMe, string returnUrl = null)
{
// Ensure the user has gone through the username & password screen first
// Ensure that the user has gone through the username & password screen first
var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();

if (user == null)
Expand Down Expand Up @@ -237,7 +238,7 @@ public async Task<IActionResult> Register(RegisterViewModel model, string return
AddErrors(result);
}

// If we got this far, something failed, redisplay form
// If execution got this far, something failed, redisplay the form.
return View(model);
}

Expand Down Expand Up @@ -376,7 +377,7 @@ public async Task<IActionResult> ForgotPassword(ForgotPasswordViewModel model)
return RedirectToAction(nameof(ForgotPasswordConfirmation));
}

// If we got this far, something failed, redisplay form
// If execution got this far, something failed, redisplay the form.
return View(model);
}

Expand Down

0 comments on commit 4b9e18d

Please sign in to comment.