It's legal if you agreed to it. It's immoral and a bit douchebaggery but not illegal.