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.
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?
To summarize, my use case requires:
- Verifying/enforcing email attribute uniqueness at the Cognito level when signing up users via Amplify's
Auth.SignUp
; - Keeping username-based login but allowing users to login with their email as well (that is,
Auth.SignIn
with email or username supplied as the username-argument).
amplify push
: my case works withAliasAttributes: ["email"]
added. The idea came from here. – Telephonic