@@ -165,6 +165,8 @@ class Web3Auth implements IWeb3Auth {
165165 } ,
166166 } ;
167167
168+ this . initParams . redirectUrl = loginParams . redirectUrl ;
169+
168170 const result = await this . openloginHandler ( `${ this . baseUrl } /start` , dataObject ) ;
169171
170172 if ( result . type !== "success" || ! result . url ) {
@@ -231,6 +233,7 @@ class Web3Auth implements IWeb3Auth {
231233 } ;
232234
233235 const url = `${ this . walletSdkUrl } /${ path } ` ;
236+ log . debug ( "url => " , url ) ;
234237 log . debug ( `[Web3Auth] config passed: ${ JSON . stringify ( dataObject ) } ` ) ;
235238 const loginId = await this . getLoginId ( dataObject ) ;
236239
@@ -248,7 +251,6 @@ class Web3Auth implements IWeb3Auth {
248251 }
249252
250253 async enableMFA ( ) : Promise < void > {
251- log . debug ( "enableMFA_1 starts" ) ;
252254 if ( ! this . ready ) throw InitializationError . notInitialized ( "Please call init first." ) ;
253255 if ( ! this . sessionManager . sessionId ) {
254256 throw new Error ( "user should be logged in." ) ;
@@ -263,7 +265,6 @@ class Web3Auth implements IWeb3Auth {
263265 redirectUrl : this . initParams . redirectUrl ,
264266 } ;
265267
266- log . debug ( "enableMFA_2 starts" ) ;
267268 const dataObject : OpenloginSessionConfig = {
268269 actionType : OPENLOGIN_ACTIONS . ENABLE_MFA ,
269270 options : this . initParams ,
@@ -274,22 +275,18 @@ class Web3Auth implements IWeb3Auth {
274275 sessionId : this . sessionManager . sessionId ,
275276 } ;
276277
277- log . debug ( "enableMFA_3 starts" ) ;
278278 const result = await this . openloginHandler ( `${ this . baseUrl } /start` , dataObject ) ;
279279
280- log . debug ( "enableMFA_4" , result ) ;
281280 if ( result . type !== "success" || ! result . url ) {
282281 log . error ( `[Web3Auth] login flow failed with error type ${ result . type } ` ) ;
283282 throw new Error ( `login flow failed with error type ${ result . type } ` ) ;
284283 }
285284
286- log . debug ( "enableMFA_5" ) ;
287285 const { sessionId, sessionNamespace, error } = extractHashValues ( result . url ) ;
288286 if ( error || ! sessionId ) {
289287 throw LoginError . loginFailed ( error || "SessionId is missing" ) ;
290288 }
291289
292- log . debug ( "enableMFA_6" ) ;
293290 if ( sessionId ) {
294291 await this . keyStore . set ( "sessionId" , sessionId ) ;
295292 this . sessionManager . sessionId = sessionId ;
0 commit comments