public ActionResult Login(string returnUrl) { ViewBag.ReturnUrl = returnUrl; HirerLoginViewModel model = new HirerLoginViewModel(); model.Action = "ExternalLogin"; model.ReturnUrl = returnUrl; return View(model); }
public async Task<ActionResult> Login(HirerLoginViewModel model, string returnUrl) { if (ModelState.IsValid) { ApplicationUser user = await UserManager.FindAsync(model.UserName, model.Password); if (user != null) { await SignInAsync(user, false); return RedirectToAction("/", "HirerWorkOrder"); } else { ModelState.AddModelError("", Machete.Web.Resources.ValidationStrings.invalidLogin); } } // If we got this far, something failed, log event & redisplay form levent.Level = LogLevel.Info; levent.Message = "Logon failed for " + model.UserName; log.Log(levent); return View(model); }