Skip to content

Commit

Permalink
If starting browser fails, render the URI to navigate to
Browse files Browse the repository at this point in the history
Users can manually navigate as a consequence and continue the flow.

This unblocks usage in WSL, for example
  • Loading branch information
kzu committed Sep 27, 2024
1 parent 931e202 commit 5621634
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Commands/GitHubAppAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ public class GitHubAppAuthenticator(IHttpClientFactory httpFactory) : IGitHubApp
try
{
// Start the browser to the verification URL
System.Diagnostics.Process.Start(new ProcessStartInfo(auth!.verification_uri) { UseShellExecute = true });
try
{
System.Diagnostics.Process.Start(new ProcessStartInfo(auth!.verification_uri) { UseShellExecute = true });
}
catch (Exception)
{
progress.Report($":globe_with_meridians: Please navigate to the following page and use the code above: {auth!.verification_uri}");
}

AuthCode? code;
do
Expand Down

0 comments on commit 5621634

Please sign in to comment.