Closed rashidwiizb closed 2 months ago
Hello, @rashidwiizb 👋 and sorry to hear you're running into this issue. Can you clarify if you're seeing this in both dev mode and production? I wonder if there's a race condition happening due to the useEffect() hook firing 2x in dev mode, and possibly being impacted by the timeouts being set.
Can you also share any relevant code snippets for your sign-in flow as well? Thanks!
Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue.
Thank you!
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
Describe the bug
I am configuring AWS Amplify with different user pools and client IDs according to the role I pass to the amplify_Config function. This works correctly, and Amplify is configured with the appropriate pool ID and client ID based on the role.
When I first select the "Student" role, it configures for the student, and then the sign-in happens successfully, and the user is logged in. However, after the current user logs out, if I choose another role and call amplify_Config in useEffect again, it reconfigures correctly. Then, when I call sign-in, Amplify tries to sign in with the previously configured user pool and client ID, resulting in an error.
But when I reload the page after selecting the role and configuring Amplify, it works fine. Is there a way to achieve this without reloading the page?
Expected behavior
without reload the screen I want to sign in the user with latest configure client and user pool
Reproduction steps
use multiple user pool and client and configure it according with changing conditions then try to signing
Code Snippet
my amplify_Config
the useeffect and reload in signIn page after selecting role
Log output
No response
aws-exports.js
No response
Manual configuration
No response
Additional configuration
hgvgh
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response