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
/// <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.)
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