Allow only Organization and Whitelisted users to Signup
We are building an enterprise document management system. So we only want to allow only users who belong to our organization or whitelisted emails.
Last updated
We are building an enterprise document management system. So we only want to allow only users who belong to our organization or whitelisted emails.
Last updated
We will use Cognito Pre-Signup Hook to validate the email address and accordingly allow users to continue.
Here is the Lambda code which does the validation.
You can configure your Cognito pool to use the above lambda function.
Now if you try to use an email that is not in the whitelist, you should see an error message. I am returning an error code EMAIL_DOMAIN_ERR
and showing the proper message on the UI side.
At this point, the whole application will only accept only whitelisted signups. So this is now ready to use and share with your users.