File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,12 +18,16 @@ declare module 'axios' {
1818 // Explicitly identifies which tenant's exchange token should be used.
1919 // When set, the interceptor skips the localStorage fallback.
2020 xTenantId ?: string ;
21+ // Forces the exchange token interceptor to run even for non-tenant-scoped
22+ // endpoints (e.g. /api/v1/billing/plans).
23+ useExchangeToken ?: boolean ;
2124 }
2225 // InternalAxiosRequestConfig is what the interceptor receives after Axios
2326 // merges defaults, so the fields must be declared here too.
2427 interface InternalAxiosRequestConfig {
2528 xResources ?: string [ ] ;
2629 xTenantId ?: string ;
30+ useExchangeToken ?: boolean ;
2731 }
2832}
2933
@@ -110,7 +114,7 @@ export async function exchangeTokenInterceptor(
110114 config : InternalAxiosRequestConfig ,
111115) {
112116 const resources = config . xResources ?? [ ] ;
113- if ( ! resources . includes ( 'tenant' ) ) {
117+ if ( ! resources . includes ( 'tenant' ) && ! config . useExchangeToken ) {
114118 return config ;
115119 }
116120
Original file line number Diff line number Diff line change @@ -42,7 +42,12 @@ export const queries = createQueryKeyStore({
4242 subscriptionPlans : ( ) => ( {
4343 queryKey : [ 'subscription-plans:list' ] ,
4444 queryFn : async ( ) =>
45- ( await cloudApi . subscriptionPlansList ( { secure : true } ) ) . data ,
45+ (
46+ await cloudApi . subscriptionPlansList ( {
47+ secure : true ,
48+ useExchangeToken : true ,
49+ } )
50+ ) . data ,
4651 } ) ,
4752
4853 paymentMethods : ( tenant : string ) => ( {
You can’t perform that action at this time.
0 commit comments