You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ReCaptcha/TagHelpers/RecaptchaInvisibleTagHelper.cs
+31-5Lines changed: 31 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,29 @@
3
3
usingGriesoft.AspNetCore.ReCaptcha.Configuration;
4
4
usingGriesoft.AspNetCore.ReCaptcha.Extensions;
5
5
usingGriesoft.AspNetCore.ReCaptcha.Localization;
6
+
usingMicrosoft.AspNetCore.Mvc.Razor.TagHelpers;
6
7
usingMicrosoft.AspNetCore.Razor.TagHelpers;
7
8
usingMicrosoft.Extensions.Options;
8
9
9
10
namespaceGriesoft.AspNetCore.ReCaptcha.TagHelpers
10
11
{
11
12
/// <summary>
12
-
/// Add a invisible reCAPTCHA div element to your page or automatically bind the invisible captcha to a button element
13
-
/// by adding a re-invisible attribute to it. Both require in addition the callback attribute.
13
+
/// Add a invisible reCAPTCHA div element to your page. Or add a 're-invisible' attribute to a button element to bind the invisible captcha to a button.
14
14
/// </summary>
15
+
/// <remarks>
16
+
/// The <see cref="FormId"/> is required. With the exception that you set a <see cref="Callback"/> instead.
17
+
/// When setting both the value set to <c>Callback</c> always wins and the <c>FormId</c> value is basically irrelevant.
18
+
///
19
+
/// For easiest use of this tag helper set only the <c>FormId</c>. This will add a default callback function to the body. That function does
20
+
/// submit the form after a successful reCAPTCHA challenge.
@@ -47,6 +61,12 @@ public RecaptchaInvisibleTagHelper(IOptionsMonitor<RecaptchaSettings> settings,
47
61
/// </summary>
48
62
publicint?TabIndex{get;set;}=null;
49
63
64
+
/// <summary>
65
+
/// The id of the form that will be submitted after a successful reCAPTCHA challenge.
66
+
/// This does only apply when not specifying a custom <see cref="Callback"/>.
67
+
/// </summary>
68
+
publicstring?FormId{get;set;}
69
+
50
70
/// <summary>
51
71
/// Set the name of your callback function, executed when the user submits a successful response. The "g-recaptcha-response" token is passed to your callback.
52
72
/// </summary>
@@ -65,12 +85,12 @@ public RecaptchaInvisibleTagHelper(IOptionsMonitor<RecaptchaSettings> settings,
0 commit comments