A contract signed in the name of a party has legal effect, but if a third party signs a contract in its name without the authorization of the party, the contract has no legal effect on the party, and all the consequences arising therefrom shall be borne by the third party who uses its name. However, if the parties authorize a third person to sign the contract on their behalf, or if the parties ratify it afterwards without knowing it, the contract signed on their behalf shall be deemed valid.