Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/backend/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

@brendan-kellam brendan-kellam Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my other comment, I'm not sure if this will break bitbucket server. Might be best to only do this if config.deploymentType is cloud

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but I can’t confirm whether it breaks Bitbucket Server or not. I only have access to Cloud.

If no one can verify it, making it conditional might be better.

? config.user.split("@")[0]
: "x-token-auth";
return {
hostUrl: config.url,
token,
Expand All @@ -197,7 +201,7 @@ export const getAuthCredentialsForRepo = async (repo: RepoWithConnections, logge
password: token
}
),
}
};
}
} else if (connection.connectionType === 'azuredevops') {
const config = connection.config as unknown as AzureDevOpsConnectionConfig;
Expand Down
Loading