public ActionResult LogOn(LogOnViewModel model, string returnUrl)
{
if (ModelState.IsValid)
{
if (accountRepository.Authenticate(model.Email, model.Password))
{
return Redirect(String.IsNullOrEmpty(returnUrl) ? Url.Action("/"): returnUrl);
}
else
{
ModelState.AddModelError("", "Incorrect email or password");
TempData["ForgotPassword"] = "ForgotPassword";
}
}
return View();
}