diff --git a/src/auth/base-auth-api.ts b/src/auth/base-auth-api.ts index 1b1efca17..ad3f96860 100644 --- a/src/auth/base-auth-api.ts +++ b/src/auth/base-auth-api.ts @@ -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; diff --git a/src/lib/retry.ts b/src/lib/retry.ts index f1b91baaf..d88702914 100644 --- a/src/lib/retry.ts +++ b/src/lib/retry.ts @@ -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; /** diff --git a/test/lib/runtime.test.ts b/test/lib/runtime.test.ts index 67544b84a..37995bbbb 100644 --- a/test/lib/runtime.test.ts +++ b/test/lib/runtime.test.ts @@ -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', @@ -603,9 +606,6 @@ describe('Runtime for AuthenticationClient', () => { domain: 'tenant.auth0.com', clientId: '123', clientSecret: '123', - retry: { - enabled: false, - }, }); try {