From 7bc4e4892e299c19980fdc91e1edfe34b643e900 Mon Sep 17 00:00:00 2001 From: Cem Baspinar Date: Wed, 19 Nov 2025 00:07:48 +0300 Subject: [PATCH 1/2] Bitbucket auth fix --- packages/backend/src/utils.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/utils.ts b/packages/backend/src/utils.ts index c2e4c495..93420829 100644 --- a/packages/backend/src/utils.ts +++ b/packages/backend/src/utils.ts @@ -186,7 +186,11 @@ export const getAuthCredentialsForRepo = async (repo: RepoWithConnections, logge const config = connection.config as unknown as BitbucketConnectionConfig; if (config.token) { const token = await getTokenFromConfig(config.token); - const username = config.user ?? 'x-token-auth'; + // Extract username from email if present (e.g., user@example.com -> user) + // Bitbucket API auth uses the full email, but git clone needs just the username + const username = config.user + ? config.user.split("@")[0] + : "x-token-auth"; return { hostUrl: config.url, token, @@ -194,10 +198,10 @@ export const getAuthCredentialsForRepo = async (repo: RepoWithConnections, logge repo.cloneUrl, { username, - password: token + password: token, } ), - } + }; } } else if (connection.connectionType === 'azuredevops') { const config = connection.config as unknown as AzureDevOpsConnectionConfig; From cf9aefef5a99b2255f6d8e8ca786a608990d11e1 Mon Sep 17 00:00:00 2001 From: Cem Baspinar Date: Wed, 19 Nov 2025 00:11:13 +0300 Subject: [PATCH 2/2] fix --- packages/backend/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/utils.ts b/packages/backend/src/utils.ts index 93420829..e11a94f7 100644 --- a/packages/backend/src/utils.ts +++ b/packages/backend/src/utils.ts @@ -198,7 +198,7 @@ export const getAuthCredentialsForRepo = async (repo: RepoWithConnections, logge repo.cloneUrl, { username, - password: token, + password: token } ), };