| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…agnization support
There was a problem hiding this comment.
Reviewed the changes. Left some comments. Please address them before merging.
Sorry, something went wrong.
|
Issue: packages/browser/src/utils/http.ts was not updated This file still has module-level getInstance() calls without an instanceId: request: AsgardeoSPAClient.getInstance().httpRequest.bind(AsgardeoSPAClient.getInstance()),
requestAll: AsgardeoSPAClient.getInstance().httpRequestAll.bind(AsgardeoSPAClient.getInstance()),This is the same pattern you fixed in all the packages/react/src/api/*.ts files. If anything uses this http util, it will always route to instance 0. Suggested fix — convert to a factory function that accepts instanceId: const createHttp = (instanceId: number = 0) => {
const client = AsgardeoSPAClient.getInstance(instanceId);
return {
request: client.httpRequest.bind(client),
requestAll: client.httpRequestAll.bind(client),
};
};
export default createHttp;Or alternatively, if this is only used internally, pass the instanceId through from the caller. |
Sorry, something went wrong.
🦋 Changeset detectedThe changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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::
Related Issues
Related PRs
Checklist
Security checks