Skip to content

Commit

Permalink
Merge pull request #132 from auth0/do-not-close-on-winforms-ie-nav-error
Browse files Browse the repository at this point in the history
Do not close WinForms legacy browser on nav error
  • Loading branch information
damieng authored Dec 2, 2019
2 parents af4a623 + f5a4404 commit 8fa6ea9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Auth0.OidcClient.WinForms/WebBrowserBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ public async Task<BrowserResult> InvokeAsync(BrowserOptions options, Cancellatio

browser.NavigateError += (s, e) =>
{
e.Cancel = true;
result.ResultType = BrowserResultType.HttpError;
result.Error = e.StatusCode.ToString();
signal.Release();
// Windows Server secure browsing requires this
if (e.Url.StartsWith(options.EndUrl))
{
e.Cancel = true;
result.ResultType = BrowserResultType.Success;
result.Response = e.Url;
signal.Release();
}
};

browser.DocumentCompleted += (s, e) =>
Expand Down

0 comments on commit 8fa6ea9

Please sign in to comment.