public JsonResult LogIn(LogInModel model) { if (ModelState.IsValid && m_UserService.ValidateUser(model)) { var rememberMe = model.RememberMe.HasValue && model.RememberMe.Value; m_AuthService.SetAuthCookie(model.Email, rememberMe); return JsonSuccess(new { IsLoggedIn = true }); } return JsonSuccess(new { IsLoggedIn = false, Error = "The user name and password provided are incorrect." }); }
public bool ValidateUser(LogInModel model) { return s_UsersToPasswords.ContainsKey(model.Email) && s_UsersToPasswords[model.Email] == model.Password; }