Example #1
0
        public ActionResult Login(LoginForm form)
        {
            var authorized = _userService.Authenticate(form.UserName, form.Password);

            if (authorized)
            {
                FormsAuthentication.SetAuthCookie(form.UserName, true);
                return RedirectToLocal(form.ReturnUrl);
            }

            ModelState.AddModelError("", "User name and password invalid");
            return View(form);
        }
Example #2
0
 public ActionResult Login(string returnUrl)
 {
     var form = new LoginForm {ReturnUrl = returnUrl};
     return View(form);
 }