Repository navigation
No CTA after mistaken deletion of oauth access #627
Description
Activity
Thank you for reporting! I definitely agree that an expired/invalidated OAuth token should prompt you to re-authenticate instead of just failing with an error like this.
In the meantime, you can force re-authentication by deleting
~/.config/gh/config.yml- addedbugSomething isn't workingSomething isn't workingpriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmeticand removedenhancementa request to improve CLIa request to improve CLI
on Mar 17, 2020 Re-classified this as "bug" since the error message is not descriptive of what is happening and doesn't provide any clue to the user about how they might fix it.
@mislav - it looks like the mitigation for forcing re-auth is specific to linux. What is the equivalent for windows?
What is the equivalent for windows?
It's the same. You just need to find
.config/gh/config.ymlin your home directoryAh found it in
%USERPROFILE%\.config- thanksI am receiving this error for every command I try after updating to gh 0.10.0 running on a Mac.
❯ gh version gh version 0.10.0 (2020-06-11) https://github.com/cli/cli/releases/tag/v0.10.0I've deleted the entire config directory and gotten a new oauth token out of it, with the new split config, thinking that might fix it.
This happens on any repo, mine or others, and the message seems like it's not able to read from the new
hosts.yml?EDIT: Not sure what changed, but things are working now. Carry on.
Having the same issue as @StephenBrown2 had, but mine hasn't fixed itself. Removing the configuration directory didn't force reauthentication.
$ gh version gh version 0.10.0 (2020-06-11) https://github.com/cli/cli/releases/tag/v0.10.0 $ gh pr list http error, 'https://api.github.com/graphql' failed (401): 'Bad credentials
@nikoheikkila Do you have GITHUB_TOKEN set in your environment by any chance?
If that is cleared, and
~/.config/ghdoes not exist, re-authentication will definitely trigger.@nikoheikkila Do you have GITHUB_TOKEN set in your environment by any chance?
If that is cleared, and
~/.config/ghdoes not exist, re-authentication will definitely trigger.Thanks! Having deleted the
GITHUB_TOKENI was able to authenticate again. Yeah, could have a proper CTA here as suggested in this thread.I had the the same problem. But I can't seem to get re-authenticated.
Deleted .config/gh
gh pr list Notice: authentication required Press Enter to open github.com in your browser...But then my browser opens to this page and I'm stuck
@whoopsmith I think that means that you first need to confirm your primary email over the web interface before you can use GitHub CLI (and most other features in your account).
@whoopsmith I think that means that you first need to confirm your primary email over the web interface before you can use GitHub CLI (and most other features in your account).
My email is listed as primary and AFAICT is confirmed. This is my active work account. If its not confirmed I don't see any sort of option to restart the process.
@whoopsmith I'm sorry, then I have no idea why you got redirected to https://github.com/settings/emails. CLI doesn't ever open that page as part of OAuth flow. Since it might be a symptom of a deeper issue, maybe you should write to [email protected]
@whoopsmith I'm sorry, then I have no idea why you got redirected to https://github.com/settings/emails. CLI doesn't ever open that page as part of OAuth flow. Since it might be a symptom of a deeper issue, maybe you should write to [email protected]
Interesting. ok Thanks. Its very strange. It was working at some point before the upgrade (version .6) but I haven't used it in a while and I didn't check it right before the upgrade.
Can I go create a auth via https://github.com/settings/developers and then manually add that to the config file?
Given that
gh auth statusand supporting auth commands are in trunk, I'm going to close this.bigbite95110 commented
on Aug 14, 2020 on Aug 14, 2020 via email · Hidden as spamshow commentMore actions
Describe the feature or problem you’d like to solve
After revoking access from github.com/settings/applications, when I try to run any command, it errors out to
http error, 'https://api.github.com/graphql' failed (401): 'Bad credentials'. It should instead identify this error and redirect to authentication.Proposed solution
This is useful in cases of mistaken deletion of oauth access. User should be shown a CTA in this case, like authentication.
Another solution is to add an authentication command