summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs')
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs
index 5900e7b..4c988a8 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs
@@ -740,10 +740,12 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
// If an Identifier is preset on this control, preload discovery on that identifier,
// but only if we're not already persisting an authentication result since that would
// be redundant.
- var response = Task.Run(() => this.GetAuthenticationResponseAsync(CancellationToken.None)).GetAwaiter().GetResult();
- if (this.Identifier != null && response == null) {
- this.PreloadDiscoveryAsync(this.Identifier, CancellationToken.None).Wait();
- }
+ this.Page.RegisterAsyncTask(new PageAsyncTask(async ct => {
+ var response = await this.GetAuthenticationResponseAsync(ct);
+ if (this.Identifier != null && response == null) {
+ await this.PreloadDiscoveryAsync(this.Identifier, ct);
+ }
+ }));
}
/// <summary>