How does magento 2 control that e-mail has to be unique?

I want to know how magento 2 controls whether e-mail exists or not when creating an account, because I've added a custom attribute so that the client can connect with its custom attribute (login) or with an email, but I can not find the way to make the custom attribute unique, i tried in installData and added the only true but no result s & # 39; please no advice