public ActionResult LogIn(FunInMotion.Gif.Model.UseViewModel user) { if (ModelState.IsValid) { //Check if the user exist var isValidUser = _userDomain.AuthenticateUser(user); if (!isValidUser) { ModelState.AddModelError("LoginError", "Login name or password provided is incorrect."); return(View()); } else { FormsAuthentication.RedirectFromLoginPage(user.Login, false); } } return(View()); }
public bool AuthenticateUser(UseViewModel user) { return(_userService.IsUserExist(user)); }