Skip to content

Print gh auth refresh instead of gh auth login when the user encounters a 401 #13066

@333fred

Description

@333fred

Describe the feature or problem you’d like to solve

gh auth refresh exists as a useful, quick reauthentication mechanism for users, but the existing error messages around gh operations due to expired tokens do not suggest this; instead, they suggest gh auth login, which has a number of extra steps involved.

Proposed solution

Instead of printing gh auth login when a token generated by gh auth login returns a 401, print gh auth refresh, so the user knows about the simpler path.

Additional context

Don't think there's anything else to add here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    authrelated to tokens, authentication state, or oauthenhancementa request to improve CLIgh-authrelating to the gh auth commandhelp wantedContributions welcomepitchpitched internally for prioritisation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions