title: Cognito authentication with username or unique email via AWS Amplify
body: <p>Amplify CLI authentication with Cognito user pools currently has two main modes, signin with username or with email. In the former case email uniqueness as a required user attribute is not being enforced.</p>
  
  <p>Cognito service by itself supports the "Also allow sign in with verified email address" option (AWS Console, User Pool Attributes-section) but it can be set only upon user pool creation (i.e. can not be modified later - checkboxes are disabled). Is it possible to enforce no duplicate emails within the user pool while allowing users to authenticate with username or with email?</p>
  
  <p>To summarize, my use case requires:</p>
  
  <ul>
  <li>Verifying/enforcing email attribute uniqueness at the Cognito level when signing up users via Amplify's <code>Auth.SignUp</code>;</li>
  <li>Keeping username-based login but allowing users to login with their email as well (that is, <code>Auth.SignIn</code> with email or username supplied as the username-argument).</li>
  </ul>