Skip to content

Commit

Permalink
Check now if email is not private instead (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
UshiHiraga authored Dec 25, 2024
1 parent d63114c commit 62e2baa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netlify/edge-functions/github-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async function getUser(token: string) {
}

const emails = (await emailResponse.json()) as Array<{ email: string; primary: boolean; visibility: string }>
const primaryEmail = emails.find((email) => email.visibility === "public")
const primaryEmail = emails.find((email) => email.visibility !== "private")

if (!primaryEmail) {
throw new Error("No public email found. Check your email settings in https://github.com/settings/emails")
Expand Down

0 comments on commit 62e2baa

Please sign in to comment.