public UserService(IUserRepository userRepository, IEncripter encripter, IJwtHandler jwtHandler) { _userRepository = userRepository; _encripter = encripter; _jwtHandler = jwtHandler; }
public void SetPassword(string password, IEncripter encriptor) { if (string.IsNullOrEmpty(password)) { throw new ActioException("Empty user password", $"User password can not be empty"); } Salt = encriptor.GetSalt(); password = encriptor.GetHash(password, Salt); }
public bool ValidatePassword(string password, IEncripter encriptor) => password.Equals(encriptor.GetHash(password, Salt));