- Newest
- Most votes
- Most comments
You can prevent SMSs from being sent to certain phonenumbers by raising an exception in the custom message lambda trigger. In the lambda you can query for example a dynamodb table that holds your list of non-allowed emails/phones and decide whether to throw the exception or not.
A common practice is also to use Cognito itself as a store for the disallowed phonenumbers and emailaddresses. If you specify that these aliases have to be unique per user Cognito will prevent the same phonenumbers and email addresses to be used for new sign-ups and emailaddress / phonenumber changes. The only thing you want to do when setting a user to disallowed is set some attribute on the user in the Cognito User Pool that you recognize in the pre-authentication lambda where you can throw an exception preventing them to log in.
Relevant content
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a year ago