Skip to content

Commit ab46b7c

Browse files
committed
Remove explicit access token validation and upsertedId check from GitHub authentication flow.
1 parent f1a3fd8 commit ab46b7c

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/backend/auth/github.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,11 @@ async function authenticateAndCreateJWT(
6565

6666
const body = await resp.json();
6767

68-
if (!body.access_token) {
69-
console.error("OAuth token exchange failed:", body);
70-
ctx.response.headers.set("Access-Control-Allow-Origin", "*");
71-
ctx.response.body = "not authorized";
72-
return;
73-
}
74-
7568
const { status, userId } = await checkUser(body.access_token, provider);
7669

7770
ctx.response.headers.set("Access-Control-Allow-Origin", "*");
7871

79-
if (status.matchedCount == 1 || status.upsertedId !== undefined) {
72+
if (status.matchedCount == 1) {
8073
const id_jwt = await createJWT(provider, userId);
8174
Sentry.captureMessage("User " + userId + " logged in", "info");
8275
ctx.response.body = id_jwt;

0 commit comments

Comments
 (0)