Skip to content

Commit

Permalink
fix(docs): link to getting email for auth'ed user in github endpoint (#…
Browse files Browse the repository at this point in the history
…11896)

* fix: updated email for auth user in github endpoint

https://docs.github.com/en/rest/users/emails?apiVersion=2022-11-28#list-public-email-addresses-for-the-authenticated-user

* Apply suggestions from code review

---------

Co-authored-by: Balázs Orbán <[email protected]>
  • Loading branch information
A91y and balazsorban44 authored Sep 25, 2024
1 parent 31d827a commit d66ee42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next-auth/src/providers/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function Github<P extends GithubProfile>(

if (!profile.email) {
// If the user does not have a public email, get another via the GitHub API
// See https://docs.github.com/en/rest/users/emails#list-public-email-addresses-for-the-authenticated-user
// See https://docs.github.com/en/rest/users/emails#list-email-addresses-for-the-authenticated-user
const res = await fetch("https://api.github.com/user/emails", {
headers: { Authorization: `token ${tokens.access_token}` },
})
Expand Down

0 comments on commit d66ee42

Please sign in to comment.