Skip to content

Commit

Permalink
fix(frontend): fix gitlab token header (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelB committed Dec 16, 2020
1 parent cdb4e5f commit e018458
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion targets/frontend/src/lib/gitlab.api.js
Expand Up @@ -15,7 +15,7 @@ export function getPipelines({ ref = "master", since }) {
return request(
`${url}/projects/${projectId}/pipelines?updated_after=${since.toISOString()}&ref=${ref}&order_by=updated_at`,
{
headers: { private_token: accessToken },
headers: { Authorization: `Bearer ${accessToken}` },
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion targets/frontend/src/lib/request.js
Expand Up @@ -10,7 +10,7 @@ export function request(endpoint, { body, ...customConfig } = {}) {
if (body) {
config.body = JSON.stringify(body);
}
console.log("[request]", endpoint);
console.log("[request]", endpoint, config.headers);
return fetch(endpoint, config).then(async (response) => {
const data = await response.json();
if (response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion targets/frontend/src/pages/index.js
Expand Up @@ -11,7 +11,7 @@ export function IndexPage() {
<Layout title="Home">
<Text>Administration des contenus et gestion des alertes</Text>
<Inline>
{/* <GitlabButton env="prod">Mettre à jour la prod</GitlabButton> */}
<GitlabButton env="prod">Mettre à jour la prod</GitlabButton>
<GitlabButton env="preprod">Mettre à jour la preprod</GitlabButton>
</Inline>
</Layout>
Expand Down

0 comments on commit e018458

Please sign in to comment.