Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate configurations across PowerAuth instances #115

Closed
hvge opened this issue Oct 7, 2022 · 0 comments
Closed

Propagate configurations across PowerAuth instances #115

hvge opened this issue Oct 7, 2022 · 0 comments
Assignees
Milestone

Comments

@hvge
Copy link
Member

hvge commented Oct 7, 2022

If we create multiple instances of PowerAuth object with the same instance identifier then all can provide functionality on top of the same underlying instance of native SDK. This is due to fact, that PowerAuth is just a thin envelope containing instanceId internally to point to the right native object.

Unfortunately, this is not valid for configuration properties available in PowerAuth class. The configuration properties are updated in configure() method so it will be available only in one instance. For example:

const sdk1 = new PowerAuth('default')
const sdk2 = new PowerAuth('default')

console.log(`sdk1 is configured = ${await sdk1.isConfigured()}`)   // false
console.log(`sdk2 is configured = ${await sdk2.isConfigured()}`)   // false

sdk1.configure(configuration)

console.log(`sdk1 is configured = ${await sdk1.isConfigured()}`)   // true
console.log(`sdk2 is configured = ${await sdk2.isConfigured()}`)   // true
console.log(`sdk1 is configured = ${sdk1.configuration}`)          // something
console.log(`sdk2 is configured = ${sdk2.configuration}`)          // null

This is normally not a big deal, but can be confusing for developers that create multiple PowerAuth instances by accident, or for any purpose. So, this is still a nice to have enhancement.

@hvge hvge added this to the 2.3.0 milestone Oct 7, 2022
@hvge hvge self-assigned this Oct 7, 2022
@hvge hvge closed this as completed in 7a9b999 Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant