From 3b5065b569446953a1547f4144a5d140b28ea7db Mon Sep 17 00:00:00 2001 From: Edward Buckle Date: Wed, 10 Jun 2020 14:42:19 +0100 Subject: [PATCH] Add username field to secure repos Signed-off-by: Edward Buckle --- src/pfe/portal/modules/Templates.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pfe/portal/modules/Templates.js b/src/pfe/portal/modules/Templates.js index 0a5c47c0a..9604fded4 100644 --- a/src/pfe/portal/modules/Templates.js +++ b/src/pfe/portal/modules/Templates.js @@ -323,6 +323,9 @@ async function constructRepositoryObject(url, description, name, isRepoProtected repository = await fetchRepositoryDetails(repository, gitCredentials); if (isRepoProtected !== undefined) { repository.protected = isRepoProtected; + if (gitCredentials && isRepoProtected) { + repository.authentication = { username: gitCredentials.username }; + } } return repository; }