driesvints / sponsors

A package for PHP to interact with GitHub Sponsors.
MIT License
104 stars 7 forks source link

Implement a check to see if a username and token belong together #11

Open driesvints opened 2 years ago

driesvints commented 2 years ago

For our Sponsorable trait we offer to set a GitHub username and token on the implementing class. But we don't actually check if the user or the token belong together. It would be good if we offered a way to users to do this or to either do this ourselves in the library before making API requests.

The way we could check this is to auth the client with the token and retrieve the user details, then check if the username is the same as the one set on the object.