[auth] Show friendlier error message when fetching current user fails
Hub is impossible to use from within GitHub Actions because specifying GITHUB_TOKEN will trigger the code path where the `user` resource is requested from the GitHub API to get the current login name, but this resource is not available for that token. This failure message was cryptic and misleading before as it was sometimes presented as HTTP 401. This change ensures that the correct HTTP 403 "Resource not accessible by integration" message is shown.
Showing
想要评论请 注册 或 登录