Skip to content

don't drop into browser flow when no auth detected #1511

Description

@vilmibm

Currently when gh detects that no host is configured when trying to do an API call it automatically puts the user in a browser-based authentication flow with the goal of returning them to what they were doing upon success.

While it's got us this far and can often feel smooth, it's been a pain point for a variety of users. This issue covers switching to a more explicit approach where, for commands that require authentication, we stop and print helpful instructions for the ways a user can authenticate.

The flow should look something like:

$ gh pr status

Hi! gh is not yet authenticated with any GitHub hosts.

For interactive authentication, please run `gh auth login`. That command will allow you to either log in using
a web browser or paste an existing token.

If you already have a token to use and don't want to store it anywhere, you can set the GITHUB_TOKEN
environment variable.

cc @ampinsk for wording/formatting suggestions.

Activity

  1. added
    enhancementa request to improve CLI
    authrelated to tokens, authentication state, or oauth
    on Aug 10, 2020
  2. self-assigned this
    on Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

authrelated to tokens, authentication state, or oauthenhancementa request to improve CLI

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions