Example #1
0
 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());
 }
Example #2
0
 public bool AuthenticateUser(UseViewModel user)
 {
     return(_userService.IsUserExist(user));
 }