Any officer authorizing, aiding to authorize, auditing, allowing, or paying any claim or demand upon or against the treasury of any county, or any fund thereof, in violation of law or of the constitution is liable personally and upon his official bond to the person damaged by such illegal action, to the extent of his loss by reason of the nonpayment of his claim.