From c8ffcc3090d56f08ecd546ccbc00702314afd0ea Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Sun, 31 Jan 2021 23:05:51 +0800 Subject: [PATCH] fix: GitHub API response is in snake case --- server/api/github.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/github.ts b/server/api/github.ts index 764cc9b..cd723a2 100644 --- a/server/api/github.ts +++ b/server/api/github.ts @@ -19,7 +19,7 @@ async function oauth(code: string) { }) const body = await res.json() - const { accessToken, scope, error_description: errorDescription } = body + const { access_token: accessToken, scope, error_description: errorDescription } = body if (errorDescription) { throw new Error(errorDescription) } else if (scope !== 'repo' || !accessToken || !(typeof accessToken === 'string')) {