mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
Merge cf9aefef5a into d63f3cf9d9
This commit is contained in:
commit
cd060b6d22
1 changed files with 6 additions and 2 deletions
|
|
@ -186,7 +186,11 @@ export const getAuthCredentialsForRepo = async (repo: RepoWithConnections, logge
|
||||||
const config = connection.config as unknown as BitbucketConnectionConfig;
|
const config = connection.config as unknown as BitbucketConnectionConfig;
|
||||||
if (config.token) {
|
if (config.token) {
|
||||||
const token = await getTokenFromConfig(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 {
|
return {
|
||||||
hostUrl: config.url,
|
hostUrl: config.url,
|
||||||
token,
|
token,
|
||||||
|
|
@ -197,7 +201,7 @@ export const getAuthCredentialsForRepo = async (repo: RepoWithConnections, logge
|
||||||
password: token
|
password: token
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
} else if (connection.connectionType === 'azuredevops') {
|
} else if (connection.connectionType === 'azuredevops') {
|
||||||
const config = connection.config as unknown as AzureDevOpsConnectionConfig;
|
const config = connection.config as unknown as AzureDevOpsConnectionConfig;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue