-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Description
When nesting multiple AuthProvider components on a single page, the login process fails or behaves unpredictably, even when a unique instanceID is provided for each.
The SDK appears to have a race condition or state collision where it cannot determine which provider instance should process the authentication response. This results in the login flow executing out of order or failing to update the isAuthenticated state for the correct provider.
Expected Behavior
Each AuthProvider defined with a unique instanceID should operate in total isolation. Triggering a login on a specific instance should process the callback and update the state only for that instance, regardless of nesting depth.
Steps to Reproduce
- Setup: Initialize two separate AuthProvider components with distinct configurations and unique instanceID props (e.g., instance_A and instance_B).
- Nest: Place the second AuthProvider inside the component tree of the first AuthProvider (nested structure) in a single page.
- Action: Trigger the signIn() method specifically from the inner provider instance.
- Observe: After the redirect, notice that the inner provider fails to complete the login process, or the outer provider incorrectly attempts to intercept the authentication callback
Please select the area the issue is related to
@asgardeo/react, @asgardeo/browser, @asgardeo/javascript
Version
N/A
Environment Details (with versions)
No response
Reporter Checklist
- I have searched the existing issues and this is not a duplicate.
- I have provided all the necessary information.
- I have tested the issue on the latest version of the package.