Skip to content

Commit

Permalink
Change retry default on Auth client
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjmcgrath committed Aug 14, 2023
1 parent 26f3092 commit e185890
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/auth/base-auth-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ export class BaseAuthAPI extends BaseAPI {
clientAssertionSigningAlg?: string;

constructor(options: AuthenticationClientOptions) {
super({ ...options, baseUrl: `https://${options.domain}`, parseError });
super({
...options,
baseUrl: `https://${options.domain}`,
parseError,
retry: { enabled: false, ...options.retry },
});

this.domain = options.domain;
this.clientId = options.clientId;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function pause(delay: number) {
export interface RetryConfiguration {
/**
* Configure the usage of retries.
* Defaults to true.
* Defaults to true on the Management Client and false on the Authentication Client.
*/
enabled?: boolean;
/**
Expand Down
6 changes: 3 additions & 3 deletions test/lib/runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,9 @@ describe('Runtime for AuthenticationClient', () => {
domain: 'tenant.auth0.com',
clientId: '123',
clientSecret: '123',
retry: {
enabled: true,
},
});
const response = await client.oauth.clientCredentialsGrant({
audience: '123',
Expand All @@ -603,9 +606,6 @@ describe('Runtime for AuthenticationClient', () => {
domain: 'tenant.auth0.com',
clientId: '123',
clientSecret: '123',
retry: {
enabled: false,
},
});

try {
Expand Down

0 comments on commit e185890

Please sign in to comment.