Skip to main content
Code Review

Return to Question

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

This is a follow-up to the other post I made (less than an hour ago) about my Google reCAPTCHA C# implementation: Google reCAPTCHA Validator Google reCAPTCHA Validator

This is a follow-up to the other post I made (less than an hour ago) about my Google reCAPTCHA C# implementation: Google reCAPTCHA Validator

This is a follow-up to the other post I made (less than an hour ago) about my Google reCAPTCHA C# implementation: Google reCAPTCHA Validator

added 362 characters in body
Source Link
Der Kommissar
  • 20.3k
  • 4
  • 70
  • 158
/// <summary>
/// Indicates errors that could be returned by the reCAPTCHA API.
/// </summary>
/// <remarks>
/// See: https://developers.google.com/recaptcha/docs/verify
/// </remarks>
[Flags]
public enum ReCaptchaErrors
{
 /// <summary>
 /// No errors occurred.
 /// </summary>
 None = 0x00,
 /// <summary>
 /// The secret parameter is missing.
 /// </summary>
 MissingInputSecret = 0x01,
 /// <summary>
 /// The secret parameter is invalid or malformed.
 /// </summary>
 InvalidInputSecret = 0x02,
 /// <summary>
 /// The response parameter is missing.
 /// </summary>
 MissingInputResponse = 0x04,
 /// <summary>
 /// The response parameter is invalid or malformed.
 /// </summary>
 InvalidInputResponse = 0x08,
}

For the updated ReCaptchaValidator, I changed the ReCaptchaLocationInclude property to BodyDivInclude as well, to make the name more meaningful. I also made ExtraClasses a get-only List, so that you cannot accidentally assign a new list to it. (You'll just have to use ReCaptchaValidator.ExtraClasses.Clear() first and then add your new classes.)

/// </summary>
/// <remarks>
/// See: https://developers.google.com/recaptcha/docs/verify
/// </remarks>
[Flags]
public enum ReCaptchaErrors
{
 /// <summary>
 /// No errors occurred.
 /// </summary>
 None = 0x00,
 /// <summary>
 /// The secret parameter is missing.
 /// </summary>
 MissingInputSecret = 0x01,
 /// <summary>
 /// The secret parameter is invalid or malformed.
 /// </summary>
 InvalidInputSecret = 0x02,
 /// <summary>
 /// The response parameter is missing.
 /// </summary>
 MissingInputResponse = 0x04,
 /// <summary>
 /// The response parameter is invalid or malformed.
 /// </summary>
 InvalidInputResponse = 0x08,
}
/// <summary>
/// Indicates errors that could be returned by the reCAPTCHA API.
/// </summary>
/// <remarks>
/// See: https://developers.google.com/recaptcha/docs/verify
/// </remarks>
[Flags]
public enum ReCaptchaErrors
{
 /// <summary>
 /// No errors occurred.
 /// </summary>
 None = 0x00,
 /// <summary>
 /// The secret parameter is missing.
 /// </summary>
 MissingInputSecret = 0x01,
 /// <summary>
 /// The secret parameter is invalid or malformed.
 /// </summary>
 InvalidInputSecret = 0x02,
 /// <summary>
 /// The response parameter is missing.
 /// </summary>
 MissingInputResponse = 0x04,
 /// <summary>
 /// The response parameter is invalid or malformed.
 /// </summary>
 InvalidInputResponse = 0x08,
}

For the updated ReCaptchaValidator, I changed the ReCaptchaLocationInclude property to BodyDivInclude as well, to make the name more meaningful. I also made ExtraClasses a get-only List, so that you cannot accidentally assign a new list to it. (You'll just have to use ReCaptchaValidator.ExtraClasses.Clear() first and then add your new classes.)

added 242 characters in body
Source Link
Der Kommissar
  • 20.3k
  • 4
  • 70
  • 158

Also, here are a couple of images with it in action:

Code Side of reCAPTCHA Validation Client Side of reCAPTCHA Validation

Also, here are a couple of images with it in action:

Code Side of reCAPTCHA Validation Client Side of reCAPTCHA Validation

deleted 3 characters in body; edited tags
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
Loading
Source Link
Der Kommissar
  • 20.3k
  • 4
  • 70
  • 158
Loading
lang-cs

AltStyle によって変換されたページ (->オリジナル) /