@@ -69,7 +69,7 @@ export class AsgardeoAuthClient<T> {
6969
7070 private cryptoHelper : IsomorphicCrypto ;
7171
72- private static instanceIdValue : number ;
72+ private instanceIdValue : number ;
7373
7474 // FIXME: Validate this.
7575 // Ref: https://github.com/asgardeo/asgardeo-auth-js-core/pull/205
@@ -121,20 +121,20 @@ export class AsgardeoAuthClient<T> {
121121 ) : Promise < void > {
122122 const { clientId} = config ;
123123
124- if ( ! AsgardeoAuthClient . instanceIdValue ) {
125- AsgardeoAuthClient . instanceIdValue = 0 ;
124+ if ( ! this . instanceIdValue ) {
125+ this . instanceIdValue = 0 ;
126126 } else {
127- AsgardeoAuthClient . instanceIdValue += 1 ;
127+ this . instanceIdValue += 1 ;
128128 }
129129
130130 if ( instanceID ) {
131- AsgardeoAuthClient . instanceIdValue = instanceID ;
131+ this . instanceIdValue = instanceID ;
132132 }
133133
134134 if ( ! clientId ) {
135- this . storageManager = new StorageManager < T > ( `instance_${ AsgardeoAuthClient . instanceIdValue } ` , store ) ;
135+ this . storageManager = new StorageManager < T > ( `instance_${ this . instanceIdValue } ` , store ) ;
136136 } else {
137- this . storageManager = new StorageManager < T > ( `instance_${ AsgardeoAuthClient . instanceIdValue } -${ clientId } ` , store ) ;
137+ this . storageManager = new StorageManager < T > ( `instance_${ this . instanceIdValue } -${ clientId } ` , store ) ;
138138 }
139139
140140 this . cryptoUtils = inputCryptoUtils ;
@@ -187,7 +187,7 @@ export class AsgardeoAuthClient<T> {
187187 */
188188 // eslint-disable-next-line class-methods-use-this
189189 public getInstanceId ( ) : number {
190- return AsgardeoAuthClient . instanceIdValue ;
190+ return this . instanceIdValue ;
191191 }
192192
193193 /**
@@ -255,6 +255,7 @@ export class AsgardeoAuthClient<T> {
255255 clientId : configData . clientId ,
256256 codeChallenge,
257257 codeChallengeMethod : PKCEConstants . DEFAULT_CODE_CHALLENGE_METHOD ,
258+ instanceId : this . getInstanceId ( ) . toString ( ) ,
258259 prompt : configData . prompt ,
259260 redirectUri : configData . afterSignInUrl ,
260261 responseMode : configData . responseMode ,
0 commit comments