Skip to content

Commit 176e605

Browse files
authored
fix: github/gitlab auth callback (conwnet#605)
1 parent 3aa8711 commit 176e605

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

functions/api/github-auth-callback.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const onRequest: PagesFunction<{
6060
const response = await fetch('https://github.com/login/oauth/access_token', {
6161
method: 'POST',
6262
body: JSON.stringify({ client_id: env.GITHUB_OAUTH_ID, client_secret: env.GITHUB_OAUTH_SECRET, code }),
63+
headers: { 'content-type': 'application/json' },
6364
});
6465
return response.json().then((result) => createResponse(response.status, result));
6566
} catch (e) {

functions/api/gitlab-auth-callback.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export const onRequest: PagesFunction<{
6868
redirect_uri: AUTH_REDIRECT_URI,
6969
grant_type: 'authorization_code',
7070
}),
71+
headers: { 'content-type': 'application/json' },
7172
});
7273
return response.json().then((result) => createResponse(response.status, result));
7374
} catch (e) {

0 commit comments

Comments
 (0)