Skip to content

Commit 4a31b7b

Browse files
authored
Update Outbound app token options schema (#547)
1 parent a7e2c62 commit 4a31b7b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ const userToken = await descopeClient.management.outboundApplication.fetchTokenB
13001300
'my-app-id',
13011301
'user-id',
13021302
['read', 'write'],
1303-
{ refreshToken: true },
1303+
{ withRefreshToken: false },
13041304
'tenant-id'
13051305
);
13061306

@@ -1309,22 +1309,22 @@ const latestUserToken = await descopeClient.management.outboundApplication.fetch
13091309
'my-app-id',
13101310
'user-id',
13111311
'tenant-id',
1312-
{ forceRefresh: true }
1312+
{ forceRefresh: false }
13131313
);
13141314

13151315
// Fetch tenant token with specific scopes
13161316
const tenantToken = await descopeClient.management.outboundApplication.fetchTenantTokenByScopes(
13171317
'my-app-id',
13181318
'tenant-id',
13191319
['read', 'write'],
1320-
{ refreshToken: true }
1320+
{ withRefreshToken: false }
13211321
);
13221322

13231323
// Fetch latest tenant token
13241324
const latestTenantToken = await descopeClient.management.outboundApplication.fetchTenantToken(
13251325
'my-app-id',
13261326
'tenant-id',
1327-
{ forceRefresh: true }
1327+
{ forceRefresh: false }
13281328
);
13291329
```
13301330

lib/management/outboundapplication.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ describe('Management OutboundApplication', () => {
243243
'app123',
244244
'user456',
245245
['read', 'write'],
246-
{ refreshToken: true },
246+
{ withRefreshToken: true, forceRefresh: true },
247247
'tenant789',
248248
);
249249

@@ -253,7 +253,7 @@ describe('Management OutboundApplication', () => {
253253
appId: 'app123',
254254
userId: 'user456',
255255
scopes: ['read', 'write'],
256-
options: { refreshToken: true },
256+
options: { withRefreshToken: true, forceRefresh: true },
257257
tenantId: 'tenant789',
258258
},
259259
{ token: 'key' },
@@ -393,7 +393,7 @@ describe('Management OutboundApplication', () => {
393393
'app123',
394394
'tenant789',
395395
['read', 'write'],
396-
{ refreshToken: true },
396+
{ withRefreshToken: true, forceRefresh: true },
397397
);
398398

399399
expect(mockHttpClient.post).toHaveBeenCalledWith(
@@ -402,7 +402,7 @@ describe('Management OutboundApplication', () => {
402402
appId: 'app123',
403403
tenantId: 'tenant789',
404404
scopes: ['read', 'write'],
405-
options: { refreshToken: true },
405+
options: { withRefreshToken: true, forceRefresh: true },
406406
},
407407
{ token: 'key' },
408408
);

lib/management/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ export type URLParam = {
953953
};
954954

955955
export type FetchOutboundAppTokenOptions = {
956-
refreshToken?: boolean;
956+
withRefreshToken?: boolean;
957957
forceRefresh?: boolean;
958958
};
959959

0 commit comments

Comments
 (0)