- Newest
- Most votes
- Most comments
This issue with the Amplify UI React Authenticator freezing after verification code entry is a common challenge with Amplify Gen 2 and Cognito integration. Based on your description, there are a few potential causes and solutions:
-
Configuration Issue: The most likely cause is incomplete Amplify configuration. You mentioned your configuration doesn't include the OAuth block, which could be contributing to the problem. However, the core issue might be related to how Amplify is configured in your application.
-
Missing Amplify.configure in Component: A critical step is ensuring that
Amplify.configure(outputs)is properly called both at the top level of your component file and within the constructor if you're using a class component. This is essential for the proper functioning of Amplify's authentication flow. -
Post-Verification Handling: By default, Cognito doesn't automatically redirect users after account confirmation or verification. The UI freezes because there's no defined behavior after the verification step completes.
Here are some solutions:
-
Fix Configuration: Ensure your Amplify configuration is complete and correctly set up. Double-check that all required parameters are included.
-
Add Proper Amplify Configuration: Make sure you have
Amplify.configure(outputs)both at the component level and in the constructor if applicable. -
Custom Verification Handler: Implement a custom handler for the verification step:
<Authenticator services={{ async handleVerifyUser(params) { try { // Handle normal verification const result = await params.handleVerifyUser(params); // After verification, attempt auto-login if (result.username && params.password) { await Auth.signIn(result.username, params.password); } return result; } catch (error) { console.error('Verification error:', error); throw error; } } }} > {/* Your app content */} </Authenticator>
-
Check for Version Compatibility: Ensure that the versions of aws-amplify and @aws-amplify/ui-react you're using are compatible with each other. Sometimes version mismatches can cause unexpected errors.
-
Clear Dependencies: If you've recently updated packages, try clearing your node_modules folder and reinstalling dependencies.
If these solutions don't resolve the issue, you might need to enable more detailed logging to get more information about the specific error occurring during the verification process.
Sources
Authenticator is not redirecting user to login page after account verification code is entered | AWS re:Post
Amplify gen 2, amplify-authenticator "There is already a signed in user." | AWS re:Post
Amplify AUTH - reat native - "An unknown error has occurred" | AWS re:Post
I have a react project that tried to switch to AWS Amplify Authenticator, but got errors: Unhandled Rejection (Error): register failed, invalid key $$typeof from plugin /src/app.tsx. | AWS re:Post
answered a year ago
Relevant content
asked 2 years ago

Tried with
oauthbut didnt work. same behaviour is occuring.And this didnt work either