public ActionResult LogIn(string returnUrl) { var model = new LogInModel { ReturnUrl = returnUrl }; return View(model); }
public async Task<ActionResult> LogIn(LogInModel model) { if (!ModelState.IsValid) { return View(); } var user = await userManager.FindAsync(model.Email, model.Password); if (user != null) { await SignIn(user); return Redirect(GetRedirectUrl(model.ReturnUrl)); } // user authN failed ModelState.AddModelError("", "Invalid email or password"); return View(); }