- Newest
- Most votes
- Most comments
It appears that there might be a misunderstanding in how the auto-verification and user verification settings work in the AWS CDK for Cognito User Pools.
The autoVerify
property you've set to { email: true }
is correct for enabling automatic verification of email addresses. However, this doesn't automatically enable the "Cognito-assisted verification and confirmation" feature.
To enable the email verification process during sign-up, you need to ensure that selfSignUpEnabled
is set to true
, which you have done correctly.
The userVerification
property you've specified is used to customize the verification message, but it doesn't control whether verification is enabled or not. It only defines the content and style of the verification message when it is sent.
To ensure that the verification email is sent and uses your custom template, you might need to adjust your configuration slightly:
- Make sure
selfSignUpEnabled
is set totrue
(which you already have). - Keep the
autoVerify: { email: true }
setting. - Ensure that
signInAliases
includes email (which you have done). - The
userVerification
property should be configured as you have it.
If after making these adjustments, you still don't see the expected behavior, it's possible that there might be a bug or limitation in the CDK version you're using. In that case, you may need to manually enable the "Cognito-assisted verification and confirmation" in the AWS Console after deployment.
Regarding the email sending service defaulting to Cognito instead of using your SES configuration, make sure that the cognitoSESRole
you're passing has the necessary permissions to send emails via SES. Also, verify that the email address and domain you're using for SES are properly verified in the SES console.
If the issue persists, you might want to consider using the cfnUserPool.overrideLogicalId()
method to ensure that CDK doesn't create a new User Pool on each deployment, which could reset your manual changes.
Remember to test thoroughly after making these changes, as email verification is a critical part of the user sign-up process.
Sources
class UserPool (construct) · AWS CDK
interface UserPoolProps · AWS CDK
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago