amplify-js: React Native Auth SignIn: Double Clicking SignIn crashes with Error: Pending sign-in attempt already in progress

Describe the bug In the react native Auth library the SignIn component does not have a pending state and the Sign In button can be tapped again before the request completes. This leads to an exception that crashes the app.

https://github.com/aws-amplify/amplify-js/blob/3e423d017a98362a0117e1218dc3fa55abbff609/packages/aws-amplify-react-native/src/Auth/SignIn.tsx#L103

To Reproduce Wrap your app with the useAuthenticator or drop the <Authenticator /> component anywhere and double click sign in after filling out fields with anything.

Expected behavior Sign In button is disabled (and loading indicator is displayed)

Code Snippet

Screenshots image

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 17 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Fix can be tested by installing aws-amplify@unstable , will be included in the next prod release

@rraczae I’m able to reproduce this consistently if I try to double-click very quickly. I’m certain this would be more consistent on a slower connection though. I’ve labeled it as a bug for the UI team to look into. Thank you!