From 89cd8224edc622df65b3d72faac5a990e6ab5137 Mon Sep 17 00:00:00 2001 From: Martin <2026226+martin-mfg@users.noreply.github.com> Date: Wed, 4 Mar 2026 21:33:31 +0100 Subject: [PATCH] fix login, extend backend log (#118) --- apps/backend/src/users.js | 5 ++++- apps/frontend/src/pages/Home/Home.tsx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/users.js b/apps/backend/src/users.js index 25e5d403..12e87457 100644 --- a/apps/backend/src/users.js +++ b/apps/backend/src/users.js @@ -61,7 +61,10 @@ async function githubAuthenticate(code, privateAccess) { const accessToken = body && body.access_token ? body.access_token : null; if (!accessToken) { - throw new Error("OAuth Error: access_token missing from response"); + throw new Error( + "OAuth Error: access_token missing from response: " + + JSON.stringify(body), + ); } const userId = await getUserFromToken(accessToken); diff --git a/apps/frontend/src/pages/Home/Home.tsx b/apps/frontend/src/pages/Home/Home.tsx index f6fcc25b..b9fc1345 100644 --- a/apps/frontend/src/pages/Home/Home.tsx +++ b/apps/frontend/src/pages/Home/Home.tsx @@ -199,7 +199,7 @@ export function HomeScreen({ stage, setStage }: HomeScreenProps): JSX.Element { // If GitHub API returns the code parameter if (url.includes("code=")) { const tempPrivateAccess = url.includes("private"); - const newUrl = url.split("?code=", 2) as [string, string]; + const newUrl = url.split("code=", 2) as [string, string]; const redirect = `${url.split(HOST)[0] as string}${HOST}/frontend`; window.history.pushState({}, "", redirect); setIsLoading(true);