- Newest
- Most votes
- Most comments
Unfortunately, there isn't a built-in way within the Cognito Hosted UI to automatically redirect users back to the confirmation page if they close it before confirming their account. However, there are a few approaches you can consider to address this issue:
-
Custom Error Page: You can create a custom error page for the "User is not confirmed" message. In this page, you can provide clear instructions on how to confirm the account, including steps to check their email for the confirmation code or request a new one.
-
Resend Confirmation Code: You can implement a "Resend confirmation code" functionality in your application. This would use the ConfirmSignUp API to send a new confirmation code to the user's email or phone number. You can then guide the user to enter this code in your application.
-
Auto-Confirmation: If appropriate for your use case, you can use a Pre Sign-up Lambda trigger to automatically confirm users from specific domains or based on certain criteria. This would bypass the need for manual confirmation entirely.
-
Custom UI Flow: While not strictly within the Hosted UI, you could implement a custom sign-up flow in your application that handles the confirmation process more smoothly. This would give you more control over the user experience but requires more development effort.
-
Verification Type as Link: If you switch to using a link for verification, you could implement a system to resend the verification email when a user attempts to log in and is found to be unconfirmed. You could then display a message informing the user that a new confirmation email has been sent.
Each of these approaches has its trade-offs in terms of user experience, security, and development effort. The best solution will depend on your specific requirements and constraints. Remember that any changes to the authentication flow should be carefully considered to maintain security and comply with your application's requirements.
Sources
Signing up and confirming user accounts - Amazon Cognito
Post confirmation Lambda trigger - Amazon Cognito
Pre sign-up Lambda trigger - Amazon Cognito
ConfirmSignUp - Amazon Cognito User Pools
Relevant content
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
