public async Task<ActionResult> UsernamePasswordAuthentication(UsernamePasswordAuthenticationViewModel model) { if (ModelState.IsValid) { try { var authInfo = await PodioClient.AuthenticateWithPassword(model.Username, model.Password); Session["UserId"] = authInfo.Ref.Id; return RedirectToAction("Index", "Leads"); } catch (PodioException ex) { TempData["podioError"] = ex.Error.ErrorDescription; } } return View("Index"); }
public ActionResult UsernamePasswordAuthentication(UsernamePasswordAuthenticationViewModel model) { if (ModelState.IsValid) { try { PodioClient.AuthenticateWithPassword(model.Username, model.Password); return RedirectToAction("Index", "Leads"); } catch (PodioException ex) { TempData["podioError"] = ex.Error.ErrorDescription; } } return View("Index"); }