AWS Cognito User Pool - how to keep phone numbers unique while phone number is not a login alias
<ol>
<li>I'm using AWS Cognito User Pool on public website.</li>
<li>Phone number is not login alias as a result of business/security requirement.</li>
<li>I have a requirement for users to have unique verified phone numbers.</li>
<li>I have to verify <em>both</em> email and phone.</li>
</ol>

<p>However, because of #2 Cognito allows several users to have the same verified phone number, thus I'm struggling with #3.</p>

<p>I've tried to use Post-Confirmation lambda, but if phone is already confirmed, lambda doesn't get triggered on email confirmation, since Cognito considers that a <em>user</em> is already confirmed after phone <em>or</em> email are confirmed - this already kills that idea, but I also suppose that even if I throw exception, user will remain confirmed.</p>

<p>Additional complexity is being added with ability of users to change their phone/email anytime out of our website (since due to publicity there is no client secret).</p>

<p>It would be ideal for me, if Cognito would have a lambda event for pre-confirmation of phone and email. But what can be a workaround here?</p>