Skip to content

gh auth login --with-token hangs #9789

@jtmcg

Description

@jtmcg

Describe the bug

gh auth login --with-token is described to accept a token on standard input. The usage example in the docs is

gh auth login --with-token < mytoken.txt

However, if I don't provide a token file using the redirect operator, the command gh auth login --with-token hangs.

Steps to reproduce the behavior

  1. Logout of github in the CLI using gh auth logout
  2. Run gh auth login --with-token
  3. See that the terminal hangs

Expected vs actual behavior

It isn't terribly clear what behavior is expected, here, but it seems like an interactive prompt for where to find the token may have been intended. However, that code seems unreachable given the conditional above it, and no implementation exists to prompt for a token when one isn't provided.

I would expect to be prompted for the token OR the token's file location if one wasn't provided using a redirect operator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsgh-authrelating to the gh auth commandneeds-designAn engineering task needs design to proceed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions