summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-03-11 18:57:50 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-03-11 18:57:50 -0800
commit3e59a1a11629e5c994b90d404bbe7150be8d10b7 (patch)
tree8a2fcd2ece00e7b27ad9acfdec66f94056caf1c6 /src
parentaac91f26a99f6d3ecf6beca4cb3b4e8a93471da5 (diff)
downloadDotNetOpenAuth-3e59a1a11629e5c994b90d404bbe7150be8d10b7.zip
DotNetOpenAuth-3e59a1a11629e5c994b90d404bbe7150be8d10b7.tar.gz
DotNetOpenAuth-3e59a1a11629e5c994b90d404bbe7150be8d10b7.tar.bz2
The edit account page now uses the selector to allow the user to add additional auth tokens.
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];