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

Verify access token validity and scopes on startup #124

Closed
sorenlouv opened this issue May 7, 2019 · 0 comments · Fixed by #128
Closed

Verify access token validity and scopes on startup #124

sorenlouv opened this issue May 7, 2019 · 0 comments · Fixed by #128

Comments

@sorenlouv
Copy link
Owner

sorenlouv commented May 7, 2019

Currently if the access token is invalid or doesn't have the correct scopes, the application will crash with this error:

Error: Command failed: git push johndoe backport/7.x/pr-12345:backport/7.x/pr-12345 --force
remote: Permission to johndoe/kibana.git denied to johndoe.
fatal: unable to access 'https://jd9aasj93j2sdakjas83a@github.com/johndoe/kibana.git/': The requested URL returned error: 403

To handle this situation more gracefully the application should initially verify that the validity and scopes of the access token.
If the access token is invalid it should exit with a helpful error message.

fetch(`https://api.github.com/${owner}/${repoName}?access_token=${accessToken}`, {
  method: 'HEAD'
})
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 a pull request may close this issue.

1 participant