- Newest
- Most votes
- Most comments
In Amazon Cognito, you can enable users to request a new verification code when they haven't confirmed their account through the ResendConfirmationCode API operation.
For users who have signed up but haven't confirmed their accounts yet, this operation sends a new confirmation code to their email address or phone number (whichever is set as an auto-verified attribute). The code is valid for 24 hours.
If you're using Cognito Managed Login, there are a few approaches to handle this situation:
-
If you're using Amplify Authenticator UI, you can customize the verification flow to include a "Resend code" option that calls the ResendConfirmationCode API when clicked.
-
For a more custom solution, you can implement a client-side handler that detects when a user is in the unconfirmed state and provides them with an option to request a new code.
-
You can also implement a post-confirmation Lambda trigger to create a more seamless experience after verification.
Without this functionality, users who don't receive or lose their verification code would indeed be stuck in an unconfirmed state, unable to fully access your application. They wouldn't be able to sign up again (as the account already exists) or reset their password (as the email isn't confirmed).
For administrator-assisted recovery, an admin can mark a user's email or phone as verified through the Amazon Cognito console by editing the user's attributes and checking "Mark email address as verified" or by setting the email_verified attribute to true using the AdminUpdateUserAttributes API.
Sources
ResendConfirmationCode - Amazon Cognito User Pools
Authenticator is not redirecting user to login page after account verification code is entered | AWS re:Post
Passwords, account recovery, and password policies - Amazon Cognito
Configuring verification and invitation messages - Amazon Cognito
Feature Request: "Resend Code" Button on Cognito Managed Login
Hello AWS Cognito team,
I would like to request a much-needed feature for the Cognito Managed Login flow:
- Please add a "Resend Code" button on the email/phone verification screen.
Currently, if a user does not receive (or loses) their verification code during sign-up, there is no way for them to request a new code directly from the Managed Login flow.
As a result, users are stuck in an unconfirmed state and cannot proceed or recover without developer/admin assistance, which leads to a poor user experience.
Many competing authentication providers include this feature by default.
This addition would make the Managed Login flow much more hassle-free and production-ready, especially for teams who want to avoid building a fully custom authentication UI.
Thank you for considering this improvement!
Relevant content
- asked 9 months ago
- asked 3 years ago
