You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No CTA after mistaken deletion of oauth access #627
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
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
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.
@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.
@mislav pointed out this wasn't fully covered by the auth commands themselves, so I'll ensure that there are sufficient CTAs in the course of doing #1511
Activity
mislav commentedon Mar 10, 2020
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.ymlmislav commentedon 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.
alex-frankel commentedon Jun 5, 2020
@mislav - it looks like the mitigation for forcing re-auth is specific to linux. What is the equivalent for windows?
mislav commentedon Jun 8, 2020
It's the same. You just need to find
.config/gh/config.ymlin your home directoryalex-frankel commentedon Jun 8, 2020
Ah found it in
%USERPROFILE%\.config- thanksStephenBrown2 commentedon Jun 12, 2020
I am receiving this error for every command I try after updating to gh 0.10.0 running on a Mac.
I'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.
nikoheikkila commentedon Jun 15, 2020
Having the same issue as @StephenBrown2 had, but mine hasn't fixed itself. Removing the configuration directory didn't force reauthentication.
mislav commentedon Jun 15, 2020
@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 commentedon Jun 16, 2020
Thanks! Having deleted the
GITHUB_TOKENI was able to authenticate again. Yeah, could have a proper CTA here as suggested in this thread.whoopsmith commentedon Jun 16, 2020
I had the the same problem. But I can't seem to get re-authenticated.
Deleted .config/gh
But then my browser opens to this page and I'm stuck
https://github.com/settings/emails
mislav commentedon Jun 16, 2020
@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 commentedon Jun 16, 2020
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.
mislav commentedon Jun 16, 2020
@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 commentedon Jun 16, 2020
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?
vilmibm commentedon Aug 13, 2020
Given that
gh auth statusand supporting auth commands are in trunk, I'm going to close this.vilmibm commentedon Aug 14, 2020
@mislav pointed out this wasn't fully covered by the auth commands themselves, so I'll ensure that there are sufficient CTAs in the course of doing #1511
bigbite95110 commentedon Aug 14, 2020