fix: Move tokens from session to cookie/store

This commit is contained in:
Andras Bacsai
2022-02-21 12:35:20 +01:00
parent 954a265965
commit fcfa8717a5
10 changed files with 108 additions and 88 deletions

View File

@@ -9,22 +9,6 @@ export const dateOptions: DateTimeFormatOptions = {
hour12: false
};
export async function getGithubToken({ apiUrl, application, githubToken }): Promise<void> {
const response = await fetch(
`${apiUrl}/app/installations/${application.gitSource.githubApp.installationId}/access_tokens`,
{
method: 'POST',
headers: {
Authorization: `Bearer ${githubToken}`
}
}
);
if (!response.ok) {
throw new Error('Git Source not configured.');
}
const data = await response.json();
return data.token;
}
export const staticDeployments = ['react', 'vuejs', 'static', 'svelte', 'gatsby', 'php'];
export const notNodeDeployments = ['php', 'docker', 'rust'];