コード例 #1
0
        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");
        }
コード例 #2
0
        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");
        }