Skip to content

Commit

Permalink
Change opening browser on Windows to not use rundll32
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikprijck committed Oct 30, 2023
1 parent 52f0d92 commit 03848e1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Auth0.OidcClient.MAUI.Platforms.Windows/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ public bool IsUriProtocolDeclared(string scheme)
/// <param name="uri">The Uri to open</param>
public void OpenBrowser(Uri uri)
{
var process = new System.Diagnostics.Process();
process.StartInfo.FileName = "rundll32.exe";
process.StartInfo.Arguments = $"url.dll,FileProtocolHandler \"{uri.ToString().Replace("\"", "%22")}\"";
process.StartInfo.UseShellExecute = true;
process.Start();
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo
{
FileName = uri.ToString(),
UseShellExecute = true
};
System.Diagnostics.Process.Start(psi);
}

public static string Encode(string value)
Expand All @@ -98,4 +99,4 @@ public static string Decode(string value)
return Encoding.UTF8.GetString(bytes);
}
}
}
}

0 comments on commit 03848e1

Please sign in to comment.