summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs5
-rw-r--r--src/DotNetOpenAuth/Mvc/OpenIdHelper.cs10
2 files changed, 11 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs b/src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs
index d50af97..505165c 100644
--- a/src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs
+++ b/src/DotNetOpenAuth/Mvc/OpenIdAjaxOptions.cs
@@ -13,10 +13,15 @@ namespace DotNetOpenAuth.Mvc {
public class OpenIdAjaxOptions {
public OpenIdAjaxOptions() {
this.AssertionHiddenFieldId = "openid_openidAuthData";
+ this.ReturnUrlHiddenFieldId = "ReturnUrl";
}
public string AssertionHiddenFieldId { get; set; }
+ public string ReturnUrlHiddenFieldId { get; set; }
+
+ public int FormIndex { get; set; }
+
public bool ShowDiagnosticTrace { get; set; }
public bool ShowDiagnosticIFrame { get; set; }
diff --git a/src/DotNetOpenAuth/Mvc/OpenIdHelper.cs b/src/DotNetOpenAuth/Mvc/OpenIdHelper.cs
index 0df4657..effd635 100644
--- a/src/DotNetOpenAuth/Mvc/OpenIdHelper.cs
+++ b/src/DotNetOpenAuth/Mvc/OpenIdHelper.cs
@@ -100,12 +100,14 @@ window.openid_trace = {1}; // causes lots of messages",
blockBuilder.WriteLine(@" window.postLoginAssertion = function (positiveAssertion) {{
$('#{0}')[0].setAttribute('value', positiveAssertion);
- if (!$('#ReturnUrl')[0].value) {{ // popups have no ReturnUrl predefined, but full page LogOn does.
- $('#ReturnUrl')[0].setAttribute('value', window.parent.location.href);
+ if ($('#{1}')[0] && !$('#{1}')[0].value) {{ // popups have no ReturnUrl predefined, but full page LogOn does.
+ $('#{1}')[0].setAttribute('value', window.parent.location.href);
}}
- document.forms[0].submit();
+ document.forms[{2}].submit();
}};",
- additionalOptions.AssertionHiddenFieldId);
+ additionalOptions.AssertionHiddenFieldId,
+ additionalOptions.ReturnUrlHiddenFieldId,
+ additionalOptions.FormIndex);
blockBuilder.WriteLine(@" $(function () {{
var box = document.getElementsByName('openid_identifier')[0];