Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use X-OAuth-Scopes response header to determine missing scopes #8

Merged
merged 4 commits into from
Jul 18, 2024

Conversation

schustafa
Copy link
Owner

Fix #6

A GitHub API response includes an X-OAuth-Scopes header that we can use to determine if a user is getting an error due to the lack of required scopes.

This change improves on the approach in #4 by checking that header in the event of a parse failure. This allows us to give more certain troubleshooting advice in that case (and makes it less likely that we'll give advice that won't fix the problem).

Rather than blindly suggesting the user refresh their token,
we can use the X-OAuth-Scopes header on the API response to
determine if the user is lacking them in the first place.
@schustafa schustafa marked this pull request as ready for review July 18, 2024 16:35
@schustafa schustafa merged commit 9e2b95c into main Jul 18, 2024
3 checks passed
@schustafa schustafa deleted the check-user-scopes-on-failure branch July 18, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scopes: Fail with more confidence
1 participant