Closed epubreader closed 9 months ago
https://stackoverflow.com/questions/35373995/github-user-email-is-null-despite-useremail-scope
please add following code when scope is user:email, thanks. const emailResponse = await fetch(https://api.github.com/user/emails); const emailData = await emailResponse.json(); setUserEmail(emailData.find(email => email.primary).email);
https://api.github.com/user/emails
if you aren't getting user's email, cuz you might not allow it, please follow this solution:
https://stackoverflow.com/questions/35373995/github-user-email-is-null-despite-useremail-scope
please add following code when scope is user:email, thanks. const emailResponse = await fetch(
https://api.github.com/user/emails
); const emailData = await emailResponse.json(); setUserEmail(emailData.find(email => email.primary).email);