public void Password_Can_Be_Hashed_And_Verified() { var correctPassword = "******"; var incorrectPassword = "******"; var hashedPassword = _service.GetHashedPassword(correctPassword); Assert.IsTrue(_service.Verify(correctPassword, hashedPassword)); Assert.IsFalse(_service.Verify(correctPassword, incorrectPassword)); }
public User GetByCredentials(string username, string inputPassword) { return(Query().Where(u => u.Username == username) .AsEnumerable() .Where(u => PasswordHashService.Verify(inputPassword, u.Password)).FirstOrDefault()); }