Skip to content

Conversation

@kavindadimuthu
Copy link
Contributor

This pull request introduces adoption of a Multiton pattern in AsgardeoSPAClient, allowing multiple authentication contexts to coexist within the same application by managing client instances via unique IDs. Several React level APIs have been updated to accept and propagate these instance IDs, ensuring correct isolation and management of authentication state per instance.

Multiton pattern implementation and API updates for instance-awareness::

  • Refactored AsgardeoSPAClient in client.ts to implement a Multiton pattern, including new static methods for managing instances (getInstance, hasInstance, destroyInstance, getInstanceKeys, destroyAllInstances), and added an instance ID accessor (getInstanceId). [1] [2] [3]
  • Updated AsgardeoReactClient and all organization-related API functions (createOrganization, getAllOrganizations, getMeOrganizations, getOrganization) in React to accept an optional instanceId parameter and use the correct client instance for requests. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Related Issues

Related PRs

Checklist

  • Followed the CONTRIBUTING guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Unit tests provided. (Add links if there are any)

Security checks

@asgardeo-github-bot
Copy link

⚠️ No Changeset found

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go.

If these changes should result in a version bump, you need to add a changeset.

Refer Release Documentation to learn how to add a changeset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants