Exemplo n.º 1
0
        public ActionResult Login(LoginDomain model, string returnUrl)
        {
            if (ModelState.IsValid && WebSecurity.Login(model.Login, model.Password, persistCookie: model.RememberMe))
            {
                return RedirectToLocal(returnUrl);
            }

            // If we got this far, something failed, redisplay form
            ModelState.AddModelError("", "The user name or password provided is incorrect.");
            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult Login(LoginDomain loginDomain, String returnUrl)
        {
            if (ModelState.IsValid && WebSecurity.Login(loginDomain.Login, loginDomain.Password, persistCookie: loginDomain.RememberMe))
            {
                return RedirectToLocal(returnUrl);
            }

            // If we got this far, something failed, redisplay form
            ModelState.AddModelError("", "The user name or password provided is incorrect.");
            return View(loginDomain);

            /*            if (_userService.IsLoginSuccessed(loginDomain.Login, loginDomain.Password))
            {
                WebSecurity.Login(loginDomain.Login, loginDomain.Password, loginDomain.RememberMe);
                return RedirectToAction("Index", "Home");
            }
            return View();*/
        }