Closed Zoly closed 4 months ago
The updates to the GithubOAuth
class enhance the retrieval of user email information from the GitHub API. A new method for fetching user emails is introduced, ensuring that obtaining a user's primary email is now a standard part of user info retrieval. This change improves the reliability of user email data integration, allowing for better handling of user interactions with the GitHub API.
Files | Change Summary |
---|---|
src/Libraries/GithubOAuth.php |
Introduced a new constant for the user emails API URL and implemented a method to fetch user emails. Updated user info method to ensure an email is mandatory, integrating the email retrieval process. |
🐇 In the code where rabbits play,
New emails hop in every day!
From GitHub’s fields, they find their way,
To brighten up our user’s stay.
With every fetch, our joy does sway! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
The /user API returns only the data the user explicitly set as public and null for those he didn't.
If the user did not set the email address public (me for example), the email address being mandatory for the process, the authentication fails returning an error message.
By using the /user/emails API in conjunction, it is possible to retrieve all the email addresses the user set in Github, regardless if they are set public or not, and select one of those (ex: primary one), for the login process to complete successfully.
Summary by CodeRabbit
New Features
Improvements