aws-amplify / amplify-ui

Amplify UI is a collection of accessible, themeable, performant React (and more!) components that can connect directly to the cloud.
https://ui.docs.amplify.aws
Apache License 2.0
831 stars 272 forks source link

Authenticator: "Create Account" Button not spinning during PreSignupLambda execution #5020

Open johnpc opened 6 months ago

johnpc commented 6 months ago

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React

Which UI component?

Authenticator

How is your app built?

Next.js

What browsers are you seeing the problem on?

Chrome, Safari

Which region are you seeing the problem in?

No response

Please describe your bug.

I have a long-ish running PreSignUp lambda function. When the user clicks "sign up" there is no indication that they successfully clicked the button.

Screen recording: https://github.com/aws-amplify/amplify-ui/assets/4824042/0b4e71a2-1874-4cce-b1f7-e22e29005cdd screen recording

After the pre signup lambda completes, THEN the spinner starts spinning.

What's the expected behaviour?

Ideally, the spinner would start spinning right away before the pre signup lambda is invoked

Help us reproduce the bug!

Clone the repo, install dependencies, and deploy resources:

git clone --single-branch --branch no-spinner https://github.com/johnpc/autoconfirm-signup-authenticator-bug no-spinner
cd no-spinner
npm install
npx amplify sandbox

Then run

npm run dev

Visit http://localhost:3000 and attempt to sign up. You'll notice that the spinner doesn't spin right away

Code Snippet

// Put your code below this line.

Console log output

No response

Additional information and screenshots

No response

esauerbo commented 6 months ago

Hi @johnpc thanks for creating this issue! We're adding this to our roadmap, and we'll update you once we get a fix out.

taphill commented 3 months ago

Is there any update on this or a workaround? I'm running into the same issue after upgrading from amplify v5 and I have not been able to find any solutions

We have a pre signup lambda trigger set in cognito that auto-confirms the user. The code for it was copied verbatim from the AWS cognito docs here

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html#aws-lambda-triggers-pre-registration-example-2

I'm also running into an issue with the signup where any error message will only be displayed once. For example, a user that already exists attempts to signup, and is shown the error message returned by Cognito with the UsernameExistsException. But, if you clear that error message and then hit signup again, you are not shown any error message. I'm assuming this issue may be related since it's only happening on signup and not signin?

This, along with the no spinner showing up, is a pretty big blocker for us at the moment so any help would be much appreciated!