You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue:
When using the getInstance() method in TypeScript and passing a string id as the first parameter, TypeScript complains that string is not assignable to a number because the first parameter of getInstance() is typed to be a number contrary to what the documentation says.
How to reproduce:
Install the lib into a TypeScript project and try calling AsgardeoSPAClient.getInstance('string')
Expected behavior:
There should be no TypeScript error. string is the preferred type for id.
Environment information (Please complete the following information; remove any unnecessary fields) :
SDK Version: 3.1.2
The text was updated successfully, but these errors were encountered:
We have made instance ID to be a number as we have an internal logic to keep the count of instances created. But of course, we can make an improvement to accept a string by separating out the counting logic when a custom instance ID is provided. We will use this issue to track this as an improvement.
As a temporary measure, we will update the documentation to match the argument type (numbers) of the current implementation to avoid any confusion.
@DonOmalVindula does it mean that the string id shouldn't be working right now if I suppress the type checker? Our use case is that we have multiple instances of the identity provider for each client (our app is meant to be integrated into apps of our clients) and we wanted to use the id of the client as id for the instance to make sure that if the user uses our app with both clients the app would still behave as expected.
Describe the issue:
When using the
getInstance()
method in TypeScript and passing a string id as the first parameter, TypeScript complains that string is not assignable to a number because the first parameter ofgetInstance()
is typed to be a number contrary to what the documentation says.How to reproduce:
Install the lib into a TypeScript project and try calling
AsgardeoSPAClient.getInstance('string')
Expected behavior:
There should be no TypeScript error. string is the preferred type for id.
Environment information (Please complete the following information; remove any unnecessary fields) :
The text was updated successfully, but these errors were encountered: