File tree Expand file tree Collapse file tree 4 files changed +13
-3
lines changed
connectors/auth-connector Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ export const CONNECTOR_STATUS = {
66 DISCONNECTING : "disconnecting" ,
77 DISCONNECTED : "disconnected" ,
88 ERRORED : "errored" ,
9+ AUTHORIZED : "authorized" ,
10+ AUTHORIZING : "authorizing" ,
911} as const ;
1012
1113export const CONNECTOR_EVENTS = {
@@ -15,8 +17,6 @@ export const CONNECTOR_EVENTS = {
1517 CONNECTORS_UPDATED : "connectors_updated" ,
1618 MFA_ENABLED : "mfa_enabled" ,
1719 REHYDRATION_ERROR : "rehydration_error" ,
18- AUTHORIZED : "authorized" ,
19- AUTHORIZING : "authorizing" ,
2020} as const ;
2121
2222export const CONNECTOR_CATEGORY = {
Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ export type ConnectorEvents = {
118118 [ CONNECTOR_EVENTS . CONNECTED ] : ( data : CONNECTED_EVENT_DATA ) => void ;
119119 [ CONNECTOR_EVENTS . DISCONNECTED ] : ( ) => void ;
120120 [ CONNECTOR_EVENTS . CONNECTING ] : ( data : { connector : string } ) => void ;
121+ [ CONNECTOR_EVENTS . AUTHORIZING ] : ( data : { connector : string } ) => void ;
122+ [ CONNECTOR_EVENTS . AUTHORIZED ] : ( data : { connector : string } ) => void ;
121123 [ CONNECTOR_EVENTS . ERRORED ] : ( error : Web3AuthError ) => void ;
122124 [ CONNECTOR_EVENTS . REHYDRATION_ERROR ] : ( error : Web3AuthError ) => void ;
123125 [ CONNECTOR_EVENTS . CONNECTOR_DATA_UPDATED ] : ( data : IConnectorDataEvent ) => void ;
Original file line number Diff line number Diff line change @@ -401,7 +401,11 @@ class AuthConnector extends BaseConnector<AuthLoginParams> {
401401 // No need to get the identity token for auth connector as it is already handled
402402 let identityTokenInfo : IdentityTokenInfo | undefined ;
403403 if ( params . getIdentityToken ) {
404+ this . status = CONNECTOR_STATUS . AUTHORIZING ;
405+ this . emit ( CONNECTOR_EVENTS . AUTHORIZING , { connector : WALLET_CONNECTORS . AUTH } ) ;
404406 identityTokenInfo = await this . getIdentityToken ( ) ;
407+ this . status = CONNECTOR_STATUS . AUTHORIZED ;
408+ this . emit ( CONNECTOR_EVENTS . AUTHORIZED , { connector : WALLET_CONNECTORS . AUTH } ) ;
405409 }
406410 this . status = CONNECTOR_STATUS . CONNECTED ;
407411 this . emit ( CONNECTOR_EVENTS . CONNECTED , {
Original file line number Diff line number Diff line change @@ -302,7 +302,11 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
302302 throw WalletInitializationError . notFound ( `Please add wallet connector for ${ connectorName } wallet, before connecting` ) ;
303303
304304 const initialChain = this . getInitialChainIdForConnector ( connector ) ;
305- const finalLoginParams = { ...loginParams , chainId : initialChain . chainId } ;
305+ const finalLoginParams = {
306+ ...loginParams ,
307+ chainId : initialChain . chainId ,
308+ getIdentityToken : this . coreOptions . initialAuthenticationMode === "connect-and-sign" ,
309+ } ;
306310
307311 // track connection started event
308312 const startTime = Date . now ( ) ;
You can’t perform that action at this time.
0 commit comments