Skip to content

Commit

Permalink
fix: github/gitlab auth callback (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
conwnet authored Dec 4, 2024
1 parent 3aa8711 commit 176e605
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions functions/api/github-auth-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +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' },
});
return response.json().then((result) => createResponse(response.status, result));
} catch (e) {
Expand Down
1 change: 1 addition & 0 deletions functions/api/gitlab-auth-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const onRequest: PagesFunction<{
redirect_uri: AUTH_REDIRECT_URI,
grant_type: 'authorization_code',
}),
headers: { 'content-type': 'application/json' },
});
return response.json().then((result) => createResponse(response.status, result));
} catch (e) {
Expand Down

0 comments on commit 176e605

Please sign in to comment.