fix(app/gitform): check if authentication is enabled before using form credentials (#8722)
parent
9567072ce0
commit
d340c4ea96
|
@ -51,7 +51,7 @@ export async function checkRepo(
|
|||
const { creds = {} } = options;
|
||||
// If no credentials were provided alter error from git to indicate repository is not found or is private
|
||||
if (
|
||||
!(creds.username && creds.password) &&
|
||||
(!(creds.username && creds.password) || !creds.gitCredentialId) &&
|
||||
details ===
|
||||
'authentication failed, please ensure that the git credentials are correct'
|
||||
) {
|
||||
|
|
|
@ -11,6 +11,10 @@ export function getAuthentication(
|
|||
| 'RepositoryGitCredentialID'
|
||||
>
|
||||
) {
|
||||
if (!model.RepositoryAuthentication) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (model.RepositoryGitCredentialID) {
|
||||
return { gitCredentialId: model.RepositoryGitCredentialID };
|
||||
}
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
|
||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
|
||||
|
|
Loading…
Reference in New Issue