cuongdevjs / reactjs-social-login

Group Hook ReactJS components for login social network
https://react-social-login.netlify.app
MIT License
172 stars 76 forks source link

Github user email is null, despite user:email scope #165

Closed epubreader closed 9 months ago

epubreader commented 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);

cuongdevjs commented 9 months ago

if you aren't getting user's email, cuz you might not allow it, please follow this solution: CleanShot 2024-01-26 at 14 45 22