From 5621634a1257a3a56ad019ff3a952a5670e3cd83 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Fri, 27 Sep 2024 15:58:12 -0300 Subject: [PATCH] If starting browser fails, render the URI to navigate to Users can manually navigate as a consequence and continue the flow. This unblocks usage in WSL, for example --- src/Commands/GitHubAppAuthenticator.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Commands/GitHubAppAuthenticator.cs b/src/Commands/GitHubAppAuthenticator.cs index eb0e314d..703587de 100644 --- a/src/Commands/GitHubAppAuthenticator.cs +++ b/src/Commands/GitHubAppAuthenticator.cs @@ -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