Skip to content

Commit 1c9614f

Browse files
authored
fix: github/gitlab auth callback (conwnet#607)
1 parent 176e605 commit 1c9614f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

functions/api/github-auth-callback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +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' },
63+
headers: { accept: 'application/json', 'content-type': 'application/json' },
6464
});
6565
return response.json().then((result) => createResponse(response.status, result));
6666
} catch (e) {

functions/api/gitlab-auth-callback.ts

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

0 commit comments

Comments
 (0)