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., [email protected] -> 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,
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