@@ -375,7 +375,8 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
375375 showOnModal : true ,
376376 } ;
377377 }
378- embedWalletConfigMap . set ( groupedAuthConnectionId || authConnectionId , authConnectionConfig ) ;
378+ const id = this . getCombinedConnectionId ( authConnectionId , groupedAuthConnectionId ) ;
379+ embedWalletConfigMap . set ( id , authConnectionConfig ) ;
379380 }
380381
381382 const dashboardConnectorConfig = {
@@ -397,13 +398,15 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
397398
398399 // only throw error if one of them is defined in the config.
399400 if ( groupedAuthConnectionId || authConnectionId ) {
400- if ( ! embedWalletConfigMap . has ( groupedAuthConnectionId || authConnectionId ) )
401+ const id = this . getCombinedConnectionId ( authConnectionId , groupedAuthConnectionId ) ;
402+ if ( ! embedWalletConfigMap . has ( id ) )
401403 throw WalletInitializationError . invalidParams (
402404 `Invalid auth connection config, authConnection: ${ key } . Missing AuthConnectionConfig from the dashboard.`
403405 ) ;
404406
405- const configFromDashboard = embedWalletConfigMap . get ( groupedAuthConnectionId || authConnectionId ) ;
407+ const configFromDashboard = embedWalletConfigMap . get ( id ) ;
406408 this . modalConfig . connectors [ WALLET_CONNECTORS . AUTH ] . loginMethods [ key as AUTH_CONNECTION_TYPE ] = {
409+ ...userConfig ,
407410 authConnection : configFromDashboard . authConnection ,
408411 authConnectionId : configFromDashboard . authConnectionId ,
409412 groupedAuthConnectionId : configFromDashboard . groupedAuthConnectionId ,
@@ -656,4 +659,12 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
656659 private getChainNamespaces = ( ) : ChainNamespaceType [ ] => {
657660 return [ ...new Set ( this . coreOptions . chains ?. map ( ( x ) => x . chainNamespace ) || [ ] ) ] ;
658661 } ;
662+
663+ private getCombinedConnectionId ( authConnectionId : string , groupedAuthConnectionId : string ) : string {
664+ let id = authConnectionId ;
665+ if ( groupedAuthConnectionId ) {
666+ id = `${ groupedAuthConnectionId } _${ authConnectionId } ` ;
667+ }
668+ return id ;
669+ }
659670}
0 commit comments