Closed yojake42 closed 1 year ago
Amplify UI components have been updated since this issue was written. We recommend using the new components over this old version. Check out the docs for that here!
If you are still experiencing this issue with the new components and in need of assistance, please feel free to comment and provide us with additional information so we can re-open this issue and be better able to assist you.
Thank you!
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
This bug has been crushing me for days before I felt the need to post this, but I've exhausted everything I can imagine.
I'm using all the default UI components for sign in/signup etc and using cognito for users. I need to determine when a sign in occurs via submitting the login form rather than refreshing the session. onAuthUIStateChange fires indistinguishably for both, and the only way I've been able to differentiate is from the handleSubmit override on the AmplifySignIn component. That said, if I create a new user in cognito, it requires a password change on first login. Calling Auth.signin does not trigger the state change in this case. With no handlesubmit override provided, it does fire the state change with a state of resettingpassword, and the UI changes to reflect that. It also works as expected when no challenges are present. I believe this to be a bug, but also highly appreciate any workarounds in the mean time.
Expected behavior
I expect that Auth.signIn would trigger the UI component's state change the same way that the default sign in does (no handleSubmit property), regardless of the presence of password/email challenges.
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
The network response when there is a challenge:
{“ChallengeName”:“NEW_PASSWORD_REQUIRED”,“ChallengeParameters”:{“requiredAttributes”:“[]“,”userAttributes”:“{\“email_verified\“:\“true\“,\“email\“:\“xxx@xxx.xxx\“}”},“Session”:“AYABeOhNfgLuKmA9I5R-MZtT97sAHQABAAdTZXJ2aWNlABBDb2duaXRvVXNlclBvb2xzAAEAB2F3cy1rbXMAS2Fybjphd3M6a21zOnVzLWVhc3QtMTo3NDU2MjM0Njc1NTU6a2V5L2IxNTVhZmNhLWJmMjktNGVlZC1hZmQ4LWE5ZTA5MzY1M2RiZQC4AQIBAHiAcAt7Ei832QLLvv5tnR-fAKEzaf-OMDg-j1aLh6qMVAHwKEp9Gc9aBjKEBJzi1PddAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMZ5C6nYpWwi8fJzalAgEQgDuuIeGJnGR9-wpSq98vEZ_ueLRQTE6ixpfijT8nSl_wJcKOQm6Mg1_3cXGjElwGVtHx_2rsrEUxnXHCHwIAAAAADAAAEAAAAAAAAAAAAAAAAACzsA-XvcIN8nrqLyuFR2qp_____wAAAAEAAAAAAAAAAAAAAAEAAADVA8wd7hZRb_0uexs_EZp3o-3khaIZ1p6G9VTlFrzTT6iT_vOkbD3Rbms2rLEKy5PU_9pvfozL9a8AoMYV1lwbmjvvQUVXmdzEqGLcGEKPw7vl4j24z5DHQJlzciDrM5o3zT-I_nKnxeHJZYij8mmgQXSV1oHbLbA-0DQ4576GDYa9oq2Yo-MBuUs-jwMgyKg3vS_Pl5xNOamtQ_l1buZQmk5s73nCXHE9ORzmlAsrrGjFLucAsDe2LcG5lFDkDzEeSSBKf2bloqBAj_qY2by5SDYthc5PA7YK-58AbGC1Nx5cDjIeMQ”}