* feat: add ability to copy one-time OAuth code while authenticating
Signed-off-by: Andrey <andrekabatareika@gmail.com>
* fix(docs): wrong example for gh auth refresh
* chore(authflow): update message to include one-time code to it
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
* chore(authflow): improve message when copied one-time code
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
* chore(authflow): don't early return error when could not copy OAuth code
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
* refactor(authflow): make code for working with OAuth code more readable
* Adjust language in `gh auth` help for clipboard
---------
Signed-off-by: Andrey <andrekabatareika@gmail.com>
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
When there was a previously valid token that was granted some scopes,
ensure all those scopes will be re-requested when doing the
authentication flow for the new token.
This is to avoid hitting the filesystem and resolving symlinks
unnecessarily. The value of executable is just used conditionally by a
handful of commands.
Adding GITHUB_TOKEN & GITHUB_ENTERPRISE_TOKEN support orthogonal to
Config was getting out of hand, especially in `auth` commands that
adjust their messaging and error status based on the presence of these
environment variables.
The new approach builds in support for tokens from environment straight
into Config object by composition. Thus, commands need not ever be
concerned with any specific environment variables.