We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
upsertedId
1 parent f1a3fd8 commit ab46b7cCopy full SHA for ab46b7c
1 file changed
src/backend/auth/github.ts
@@ -65,18 +65,11 @@ async function authenticateAndCreateJWT(
65
66
const body = await resp.json();
67
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
-
75
const { status, userId } = await checkUser(body.access_token, provider);
76
77
ctx.response.headers.set("Access-Control-Allow-Origin", "*");
78
79
- if (status.matchedCount == 1 || status.upsertedId !== undefined) {
+ if (status.matchedCount == 1) {
80
const id_jwt = await createJWT(provider, userId);
81
Sentry.captureMessage("User " + userId + " logged in", "info");
82
ctx.response.body = id_jwt;
0 commit comments