Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Streamline renewal of gh auth token #8846

Copy link
Copy link

Description

@jonathan-enf
Issue body actions

Describe the feature or problem you’d like to solve

It would be great if there was a way to streamline the renewal of an expired github authentication token.

Currently:

$ gh auth status
github.com
  X Failed to log in to github.com account jonathan-enf (/home/jonathan/.config/gh/hosts.yml)
  - Active account: true
  - The token in /home/jonathan/.config/gh/hosts.yml is invalid.
  - To re-authenticate, run: gh auth login -h github.com
  - To forget about this account, run: gh auth logout -h github.com -u jonathan-enf
$ gh auth login -h github.com -p ssh
? Upload your SSH public key to your GitHub account? /home/jonathan/.ssh/id_ed25519.pub
? Title for your SSH key: GitHub CLI
? How would you like to authenticate GitHub CLI? Paste an authentication token
Tip: you can generate a Personal Access Token here https://github.com/settings/tokens
The minimum required scopes are 'repo', 'read:org', 'admin:public_key'.
? Paste your authentication token:

The problem here is that the message reads To re-authenticate, run: gh auth login -h github.com makes the user go through the whole token creation process a second time, including specifying scopes (which the user can get wrong). It would be better if the re-authentication instruction provided a shortcut to creating a new token with the same scopes as the expired token.

Proposed solution

Provide an interface to create a new token based on the expired token, so that the scopes don't have to be filled out again. This could be accomplished by adding a "renew" button next to the "delete" button in the web ui (https://github.com/settings/tokens), and by having gh auth login -h github.com create a link that navigates to the "renew" interface instead of the "create new token" interface.

Alternately, this problem could be resolved using a CLI-only change by letting the user specify all scopes in the gh auth login command, and extra points for having gh auth status provide the user with a command to run that already populates the scopes arguments.

Additional context

n/a.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIa request to improve CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.