public async Task<ActionResult> Index(AuthenticationModel model) { if (ModelState.IsValid) { using (var client = new DataServiceClient()) { int authenticated = await client.authenticateUserAsync(model.ssn, model.password); if (authenticated > 0) { Session["ApplicantId"] = authenticated; Session["Status"] = "LoggedIn"; Session["PersonalInfo"] = "Done"; return RedirectToAction("Index", "PersonalInfo"); } else { ModelState.AddModelError("password", "User name or password does not match."); } } } return View(model); }