-
Couldn't load subscription status.
- Fork 7.3k
support auth login --web #1642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support auth login --web #1642
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me. Do we want to add any text to the example heredoc as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! However, if the purpose of --web is to skip seeing prompts, if I'm reading #1604 correctly, then we have more more prompts to get rid of:
-
If an authentication token exists and it's valid, there will be a prompt “Do you want to re-authenticate?”
I suggest that we simply exit at this point without prompting, and pointing the user to
gh auth refreshif they want to rotate their credentials. -
The “Choose default git protocol” prompt follows successful authentication. Should this prompt still be active in
--webmode? -
There is also the “What account do you want to log into?”, but that prompt can already be avoided by specifying
-h github.comas #1604 already points out, so we don't have to do anything about that one. It's worth keeping in mind that--webdoes not guarantee a prompt-free experience unless paired with--host.
|
My understanding was that |
|
The However, if the user passes both the Going through @mislav's points:
👍 This makes sense to me as the behavior when both
Let's skip this if both Does that make sense? Apologies for the lack of clarity in the original issue! 🙇♀️ |
It looks to be resetting my |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how this ended up with the symmetry between --web and --with-token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing. Thank you for the hard work!
After mislav's feedback and talking through this with amanda I decided to go with
--webjust skipping all prompts. It felt wrong to do anything else messing with this myself in the terminal and now--with-tokenand--webare more symmetric.The end result is something like:

I chose to be explicit about setting the
git_protocolvalue so that a user gets a hint about how to change it if they desiressh.closes #1604