Skip to content

Commit 60b55e1

Browse files
committed
checkpoint
1 parent a4276c1 commit 60b55e1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/auth/oauth.server.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,18 @@ export async function fetchGitHubProfile(
274274
},
275275
})
276276
const emails = await emailResponse.json()
277+
278+
if (!Array.isArray(emails)) {
279+
console.error(
280+
`[OAuth] GitHub emails API returned non-array response:`,
281+
emails,
282+
)
283+
throw new AuthError(
284+
emails?.message || 'Failed to fetch GitHub emails',
285+
'OAUTH_ERROR',
286+
)
287+
}
288+
277289
const primaryEmail = emails.find(
278290
(e: { primary: boolean; verified: boolean; email: string }) =>
279291
e.primary && e.verified,

0 commit comments

Comments
 (0)