Skip to content

Commit

Permalink
tollerate invalid github credentials when getting repos. (#773)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Köhler <jonathan.koehler@adesso.de>
  • Loading branch information
sMeilbeck and jonycoo authored Nov 8, 2024
1 parent 38340f2 commit f26403e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/src/helpers/projectManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function execRepositoryRequests(link, user, password, ownerId, githubId) {
const reqOptions = {headers: {'Authorization': 'Basic ' + Buffer.from(`${user}:${password}`).toString('base64')}}
fetch(link, reqOptions)
.then((response) => {
if (response.status === 401) resolve([]);
if (response.status === 401) reject("github fetch failed (Unauthorized): " + response.status)
return response})
.then((response) => {
if (response.status !== 200) reject(response.status);
Expand All @@ -185,8 +185,8 @@ function execRepositoryRequests(link, user, password, ownerId, githubId) {
projects.push(proj);
}
resolve(projects);
})
});
}).catch((reason) => {console.error("problem getting the github projects");resolve([]);return []});
}).catch(() => [])
}

function ownRepositories(ownerId, githubId, githubName, token) {
Expand Down

0 comments on commit f26403e

Please sign in to comment.