From 337f8b08e6eda8054454fdd71353c3d9002c3886 Mon Sep 17 00:00:00 2001 From: Zai Shi Date: Wed, 5 Mar 2025 13:54:08 -0800 Subject: [PATCH] fixed github user info api --- apps/backend/src/oauth/providers/github.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/oauth/providers/github.tsx b/apps/backend/src/oauth/providers/github.tsx index 0c65a7f73..ffabd1b64 100644 --- a/apps/backend/src/oauth/providers/github.tsx +++ b/apps/backend/src/oauth/providers/github.tsx @@ -32,7 +32,8 @@ export class GithubProvider extends OAuthBaseProvider { async postProcessUserInfo(tokenSet: TokenSet): Promise { const rawUserInfoRes = await fetch("https://api.github.com/user", { headers: { - Authorization: `token ${tokenSet.accessToken}`, + Authorization: `Bearer ${tokenSet.accessToken}`, + "X-GitHub-Api-Version": "2022-11-28", }, }); if (!rawUserInfoRes.ok) { @@ -47,7 +48,8 @@ export class GithubProvider extends OAuthBaseProvider { const emailsRes = await fetch("https://api.github.com/user/emails", { headers: { - Authorization: `token ${tokenSet.accessToken}`, + Authorization: `Bearer ${tokenSet.accessToken}`, + "X-GitHub-Api-Version": "2022-11-28", }, }); if (!emailsRes.ok) {