mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 13:55:21 +02:00
fix(app/gitform): check if authentication is enabled before using form credentials (#8722)
This commit is contained in:
parent
9567072ce0
commit
d340c4ea96
3 changed files with 6 additions and 1 deletions
|
@ -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 };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue