Skip to content

Commit

Permalink
fix: github/gitlab auth callback (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
conwnet authored Dec 4, 2024
1 parent 176e605 commit 1c9614f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion functions/api/github-auth-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const onRequest: PagesFunction<{
const response = await fetch('https://github.com/login/oauth/access_token', {
method: 'POST',
body: JSON.stringify({ client_id: env.GITHUB_OAUTH_ID, client_secret: env.GITHUB_OAUTH_SECRET, code }),
headers: { 'content-type': 'application/json' },
headers: { accept: 'application/json', 'content-type': 'application/json' },
});
return response.json().then((result) => createResponse(response.status, result));
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion functions/api/gitlab-auth-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const onRequest: PagesFunction<{
redirect_uri: AUTH_REDIRECT_URI,
grant_type: 'authorization_code',
}),
headers: { 'content-type': 'application/json' },
headers: { accept: 'application/json', 'content-type': 'application/json' },
});
return response.json().then((result) => createResponse(response.status, result));
} catch (e) {
Expand Down

0 comments on commit 1c9614f

Please sign in to comment.