diff --git a/packages/backend-defaults/src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.ts b/packages/backend-defaults/src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.ts index f078b5c71e..ff6ec3bb27 100644 --- a/packages/backend-defaults/src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.ts +++ b/packages/backend-defaults/src/entrypoints/urlReader/lib/BitbucketCloudUrlReader.ts @@ -70,7 +70,7 @@ export class BitbucketCloudUrlReader implements UrlReaderService { this.deps = deps; const { host, username, appPassword, token } = integration.config; - if (username && (!token || !appPassword)) { + if (username && !token && !appPassword) { throw new Error( `Bitbucket Cloud integration for '${host}' has configured a username but is missing a required token or appPassword.`, ); diff --git a/packages/integration/src/bitbucketCloud/config.test.ts b/packages/integration/src/bitbucketCloud/config.test.ts index 28322909a6..9488c8b5f7 100644 --- a/packages/integration/src/bitbucketCloud/config.test.ts +++ b/packages/integration/src/bitbucketCloud/config.test.ts @@ -143,7 +143,9 @@ describe('readBitbucketCloudIntegrationConfig', () => { readBitbucketCloudIntegrationConfig( buildConfig({ ...valid, appPassword: undefined, token: undefined }), ), - ).toThrow(/must configure either a token or appPassword/); + ).toThrow( + /must be configured with as username and either a token or an appPassword/, + ); }); it('credentials hidden on the frontend', async () => {