Skip to content

User redirected to /error page after sign up

0

Hello, I have Cognito set up and working. I want to change it so that after signup, users are only confirmed by an admin of Cognito, however when I disable "Allow Cognito to automatically send messages to verify and confirm", after a user signs up they get redirected to /error page. Is there a workaround for this?

Enter image description here

1 Answer
0

Hello,

Based on your case notes, I understand that you are using Hosted UI with SignUp feature for registering new users into your userpool/application. You would like to confirm the user by Admin. You tried disabling “Allow Cognito to automatically send messages to verify and confirm” however post registering the user it is returning an error message "An error was encountered with the requested page."

When creating a new user pool there is an option under "Attribute verification and user account confirmation" to "Not Allow Cognito to automatically send messages to verify and confirm users”. When you disable ‘Allow Cognito to automatically send messages to verify and confirm’, you need to use administrative API actions or Lambda triggers to verify attributes and confirm users.

With this configuration in place, whenever a user registers/sign-up into your userpool, the user will be created in the userpool with "UNCONFIRMED" state. The user will not be able to login until the admin confirms the user entity from userpool. Please note that, after setting the value to “Not Allow Cognito to automatically send messages to verify and confirm users” i.e. once the user fill all the details & click the “Sign up” button, the user is redirected to a page with message “An error was encountered with the requested page.” Upon looking internally, I see that this is the expected behavior for hosted UI in case the Admin has to perform verification instead of the user itself. However, inspite of this error the user is signed up and Admin can then confirm that user.

[+]- You can also refer to this documentation for further clarification - https://docs.aws.amazon.com/cognito/latest/developerguide/signing-up-users-in-your-app.html#signing-up-users-in-your-app-and-confirming-them-as-admin

Hence, you can use AdminConfirmSignUp [1] or write a custom pre-signup lambda trigger [2] to confirm users.

I hope the above information is helpful to you. Thank you and have a great day ahead.

References:-

[1] Creating User Accounts as Administrator - https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-create-user-accounts.html

[2] https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html

AWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.