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
auth refresh makes it easy to authorise the wrong account in the browser #14841
Describe the feature or problem you’d like to solve
Currently, gh auth refresh only refreshes the active account. The help text says that to refresh another account you have to gh auth switch to it first, and then switch back when you are done.
That part is fine, but the browser has no idea which account gh is refreshing. When I am signed in to multiple accounts on github.com, the device flow page shows a multi account interstitial asking which account to continue with. Nothing on that page tells me which account gh expects, so it is easy to pick the wrong one.
If I do, I only find out at the very end, when gh rejects the token here:
returnfmt.Errorf("error refreshing credentials for %s, received credentials for %s, did you use the correct account in the browser?", activeUser, result.Username)
At that point the device code has been used, so the only option is to run the whole flow again and hope I click the right account this time.
Proposed solution
I don't think gh can fix this on its own, because the account picker lives on the OAuth page. OpenID Connect defines a login_hint parameter for exactly this, so the client can tell the server which account it expects.
Acceptance Criteria
Given I am signed in to github.com in my browser as monalisa and hubot And Givenmonalisa is the active account in gh auth status When I run gh auth refresh and open the verification URL Then the browser only offers to continue as monalisa
Current release 2.103.3 does not provide a way to tell the browser which GitHub account should complete gh auth refresh. The command refreshes the active account, starts the shared OAuth device flow without an account hint, and only checks the returned username after authorization. This means the requested behavior is not currently supported. The request is clear and actionable, though the exact server parameter may differ from OpenID Connect's login_hint because this path uses OAuth device authorization. The desired account-selection outcome remains a valid enhancement.
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the
help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
Activity
cli-triage commentedon Nov 9, 2026
Current release 2.103.3 does not provide a way to tell the browser which GitHub account should complete
gh auth refresh. The command refreshes the active account, starts the shared OAuth device flow without an account hint, and only checks the returned username after authorization. This means the requested behavior is not currently supported. The request is clear and actionable, though the exact server parameter may differ from OpenID Connect'slogin_hintbecause this path uses OAuth device authorization. The desired account-selection outcome remains a valid enhancement.Supporting reports
Duplicate analysis
Label reasoning
Investigation notes
Generated by issue triage.
github-actions commentedon Nov 9, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.