@@ -123,7 +123,7 @@ export class Auth {
123123 }
124124
125125 get appState ( ) : string {
126- return this . state . userInfo . appState || this . dappState || "" ;
126+ return this . state ? .userInfo ? .appState || this . dappState || "" ;
127127 }
128128
129129 get baseUrl ( ) : string {
@@ -321,7 +321,7 @@ export class Auth {
321321 } ;
322322
323323 const result = await this . authHandler ( `${ this . baseUrl } /start` , dataObject , POPUP_TIMEOUT ) ;
324- if ( ! result ) return null ;
324+ if ( ! result ) return false ;
325325 if ( isAuthFlowError ( result ) ) {
326326 this . dappState = result . state ;
327327 throw LoginError . loginFailed ( result . error ) ;
@@ -399,7 +399,7 @@ export class Auth {
399399 } ;
400400
401401 const result = await this . authHandler ( `${ this . baseUrl } /start` , dataObject ) ;
402- if ( ! result ) return undefined ;
402+ if ( ! result ) return false ;
403403 if ( isAuthFlowError ( result ) ) return false ;
404404 return true ;
405405 }
@@ -418,7 +418,7 @@ export class Auth {
418418 } ;
419419
420420 const result = await this . authHandler ( `${ this . baseUrl } /start` , dataObject ) ;
421- if ( ! result ) return undefined ;
421+ if ( ! result ) return false ;
422422 if ( isAuthFlowError ( result ) ) return false ;
423423 return true ;
424424 }
@@ -437,7 +437,7 @@ export class Auth {
437437 } ;
438438
439439 const result = await this . authHandler ( `${ this . baseUrl } /start` , dataObject ) ;
440- if ( ! result ) return undefined ;
440+ if ( ! result ) return false ;
441441 if ( isAuthFlowError ( result ) ) return false ;
442442 return true ;
443443 }
@@ -479,7 +479,7 @@ export class Auth {
479479 }
480480 }
481481
482- private async _authorizeSession ( ) : Promise < AuthSessionData > {
482+ private async _authorizeSession ( ) : Promise < AuthSessionData | null > {
483483 try {
484484 const result = await this . sessionManager . authorize ( ) ;
485485 return result ;
@@ -499,7 +499,7 @@ export class Auth {
499499 this . updateState ( result ) ;
500500 }
501501
502- private async authHandler ( url : string , dataObject : AuthRequestPayload , popupTimeout = 1000 * 10 ) : Promise < AuthFlowResult | undefined > {
502+ private async authHandler ( url : string , dataObject : AuthRequestPayload , popupTimeout = 1000 * 10 ) : Promise < AuthFlowResult | null > {
503503 const loginId = StorageManager . generateRandomSessionKey ( ) ;
504504 await this . storeAuthPayload ( loginId , dataObject ) ;
505505 const configParams : BaseLoginParams = {
@@ -514,7 +514,7 @@ export class Auth {
514514 hash : { b64Params : jsonToBase64 ( configParams ) } ,
515515 } ) ;
516516 window . location . href = loginUrl ;
517- return undefined ;
517+ return null ;
518518 }
519519
520520 const loginUrl = constructURL ( {
0 commit comments