Merge branch 'main' into fix/github-token

This commit is contained in:
Andras Bacsai
2022-02-21 09:51:46 +01:00
committed by GitHub
90 changed files with 1600 additions and 1115 deletions

View File

@@ -15,8 +15,8 @@ export const get: RequestHandler = async (event) => {
let githubToken = null;
let ghToken = null;
let isRunning = false;
const { id } = event.params;
try {
const application = await db.getApplication({ id, teamId });
const { gitSource } = application;
@@ -52,15 +52,20 @@ export const get: RequestHandler = async (event) => {
if (application.destinationDockerId) {
isRunning = await checkContainer(application.destinationDocker.engine, id);
}
return {
const payload = {
body: {
isRunning,
ghToken,
githubToken,
application,
appId
}
},
headers: {}
};
if (ghToken) {
payload.headers = {
'set-cookie': [`ghToken=${ghToken}; HttpOnly; Path=/; Max-Age=15778800;`]
};
}
return payload;
} catch (error) {
console.log(error);
return ErrorHandler(error);