private static void blowUpIfEmployeeCannotLogin(User user) { if (user == null) { throw new InvalidCredentialException( "That user doesn't exist or is not valid."); } }
public ActionResult Edit(UserForm form) { if (ModelState.IsValid) { //mapping from conferenceform to conference User user = new User(); _userMapper.MapToModel1(form, user); //saving the conference with the repository _userRepository.Save(user); form = _userMapper.Map(user); return View(form); } return View(form); }
public void LogIn(User user) { blowUpIfEmployeeCannotLogin(user); FormsAuthentication.RedirectFromLoginPage(user.Username, false); }
public bool PasswordMatches(User user, string password) { string passwordHash = _cryptographer.GetPasswordHash(password, user.PasswordSalt); return passwordHash.Equals(user.PasswordHash); }