@@ -273,7 +273,7 @@ export class AppManagementClient implements DeveloperPlatformClient {
273273 cacheExtraKey : userId ,
274274 } ,
275275 token : businessPlatformToken ,
276- unauthorizedHandler : this . createUnauthorizedHandler ( ) ,
276+ unauthorizedHandler : this . createUnauthorizedHandler ( 'businessPlatform' ) ,
277277 } )
278278
279279 if ( getPartnersToken ( ) && userInfoResult . currentUserAccount ) {
@@ -856,7 +856,7 @@ export class AppManagementClient implements DeveloperPlatformClient {
856856 token : await this . businessPlatformToken ( ) ,
857857 organizationId : String ( numberFromGid ( orgId ) ) ,
858858 variables,
859- unauthorizedHandler : this . createUnauthorizedHandler ( ) ,
859+ unauthorizedHandler : this . createUnauthorizedHandler ( 'appManagement' ) ,
860860 } )
861861 const provisionResult = fullResult . organizationUserProvisionShopAccess
862862 if ( ! provisionResult . success ) {
@@ -1057,7 +1057,7 @@ export class AppManagementClient implements DeveloperPlatformClient {
10571057 token : await this . businessPlatformToken ( ) ,
10581058 organizationId,
10591059 variables,
1060- unauthorizedHandler : this . createUnauthorizedHandler ( ) ,
1060+ unauthorizedHandler : this . createUnauthorizedHandler ( 'appManagement' ) ,
10611061 } )
10621062 const result : { [ flag : ( typeof allBetaFlags ) [ number ] ] : boolean } = { }
10631063 allBetaFlags . forEach ( ( flag ) => {
@@ -1072,7 +1072,7 @@ export class AppManagementClient implements DeveloperPlatformClient {
10721072 return appManagementRequestDoc ( {
10731073 ...options ,
10741074 token : await this . token ( ) ,
1075- unauthorizedHandler : this . createUnauthorizedHandler ( ) ,
1075+ unauthorizedHandler : this . createUnauthorizedHandler ( 'appManagement' ) ,
10761076 } )
10771077 }
10781078
@@ -1082,7 +1082,7 @@ export class AppManagementClient implements DeveloperPlatformClient {
10821082 return appDevRequestDoc ( {
10831083 ...options ,
10841084 token : await this . token ( ) ,
1085- unauthorizedHandler : this . createUnauthorizedHandler ( ) ,
1085+ unauthorizedHandler : this . createUnauthorizedHandler ( 'appManagement' ) ,
10861086 } )
10871087 }
10881088
@@ -1092,7 +1092,7 @@ export class AppManagementClient implements DeveloperPlatformClient {
10921092 return businessPlatformRequestDoc ( {
10931093 ...options ,
10941094 token : await this . businessPlatformToken ( ) ,
1095- unauthorizedHandler : this . createUnauthorizedHandler ( ) ,
1095+ unauthorizedHandler : this . createUnauthorizedHandler ( 'businessPlatform' ) ,
10961096 } )
10971097 }
10981098
@@ -1102,7 +1102,7 @@ export class AppManagementClient implements DeveloperPlatformClient {
11021102 return businessPlatformOrganizationsRequestDoc ( {
11031103 ...options ,
11041104 token : await this . businessPlatformToken ( ) ,
1105- unauthorizedHandler : this . createUnauthorizedHandler ( ) ,
1105+ unauthorizedHandler : this . createUnauthorizedHandler ( 'businessPlatform' ) ,
11061106 } )
11071107 }
11081108
@@ -1112,7 +1112,7 @@ export class AppManagementClient implements DeveloperPlatformClient {
11121112 return functionsRequestDoc < TResult , TVariables > ( {
11131113 ...options ,
11141114 token : await this . token ( ) ,
1115- unauthorizedHandler : this . createUnauthorizedHandler ( ) ,
1115+ unauthorizedHandler : this . createUnauthorizedHandler ( 'appManagement' ) ,
11161116 } )
11171117 }
11181118
@@ -1122,12 +1122,14 @@ export class AppManagementClient implements DeveloperPlatformClient {
11221122 return webhooksRequestDoc < TResult , TVariables > ( {
11231123 ...options ,
11241124 token : await this . token ( ) ,
1125- unauthorizedHandler : this . createUnauthorizedHandler ( ) ,
1125+ unauthorizedHandler : this . createUnauthorizedHandler ( 'appManagement' ) ,
11261126 } )
11271127 }
11281128
1129- private createUnauthorizedHandler ( ) : UnauthorizedHandler {
1130- return createUnauthorizedHandler ( this )
1129+ private createUnauthorizedHandler (
1130+ tokenType : 'appManagement' | 'businessPlatform' = 'appManagement' ,
1131+ ) : UnauthorizedHandler {
1132+ return createUnauthorizedHandler ( this , tokenType )
11311133 }
11321134}
11331135
0 commit comments