Skip to content

Commit

Permalink
Just prepare to release the 1.1.1 version.
Browse files Browse the repository at this point in the history
  • Loading branch information
1001binary committed Apr 1, 2015
1 parent 8c14a3a commit a3a23c3
Show file tree
Hide file tree
Showing 38 changed files with 39 additions and 6 deletions.
4 changes: 2 additions & 2 deletions GoogleRecaptcha.WebForms/Default.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<title>Test the Google Recapcha V2 Server Control</title>
</head>
<body>
<form id="frm" runat="server">
<div>
<asp:RecaptchaV2Control SiteKey="6LeF-QMTAAAAAPBTi98JAMFTF1lBzKrbyCri0JB_" SecretKey="6LeF-QMTAAAAAOw8M2RTtxoY6ifOhhUb4GlXpdB3" runat="server"/>
<asp:RecaptchaV2Control ID="gRecapcha" SiteKey="6LeF-QMTAAAAAPBTi98JAMFTF1lBzKrbyCri0JB_" SecretKey="6LeF-QMTAAAAAOw8M2RTtxoY6ifOhhUb4GlXpdB3" runat="server"/>
</div>
<asp:Button ID="btnVerify" runat="server" Text="Submit" OnClick="btnVerify_OnClick"/>
</form>
Expand Down
9 changes: 9 additions & 0 deletions GoogleRecaptcha.WebForms/Default.aspx.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified GoogleRecaptcha.WebForms/bin/GoogleRecaptcha.WebForms.dll
Binary file not shown.
Binary file modified GoogleRecaptcha.WebForms/bin/GoogleRecaptcha.WebForms.pdb
Binary file not shown.
Binary file modified GoogleRecaptcha.WebForms/bin/GoogleRecaptcha.dll
Binary file not shown.
Binary file modified GoogleRecaptcha.WebForms/bin/GoogleRecaptcha.pdb
Binary file not shown.
Binary file modified GoogleRecaptcha.WebForms/bin/GoogleRecaptchaWebForms.dll
Binary file not shown.
Binary file modified GoogleRecaptcha.WebForms/bin/GoogleRecaptchaWebForms.pdb
Binary file not shown.
Binary file not shown.
Binary file modified GoogleRecaptcha.WebForms/obj/Debug/GoogleRecaptcha.WebForms.dll
Binary file not shown.
Binary file modified GoogleRecaptcha.WebForms/obj/Debug/GoogleRecaptcha.WebForms.pdb
Binary file not shown.
Binary file modified GoogleRecaptcha.WebMvc/bin/GoogleRecaptcha.WebMvc.dll
Binary file not shown.
Binary file modified GoogleRecaptcha.WebMvc/bin/GoogleRecaptcha.WebMvc.pdb
Binary file not shown.
Binary file modified GoogleRecaptcha.WebMvc/bin/GoogleRecaptcha.dll
Binary file not shown.
Binary file modified GoogleRecaptcha.WebMvc/bin/GoogleRecaptcha.pdb
Binary file not shown.
Binary file modified GoogleRecaptcha.WebMvc/bin/GoogleRecaptchaMvc.dll
Binary file not shown.
Binary file modified GoogleRecaptcha.WebMvc/bin/GoogleRecaptchaMvc.pdb
Binary file not shown.
Binary file not shown.
Binary file modified GoogleRecaptcha.WebMvc/obj/Debug/GoogleRecaptcha.WebMvc.dll
Binary file not shown.
Binary file modified GoogleRecaptcha.WebMvc/obj/Debug/GoogleRecaptcha.WebMvc.pdb
Binary file not shown.
Binary file modified GoogleRecaptcha.v12.suo
Binary file not shown.
4 changes: 2 additions & 2 deletions GoogleRecaptcha/RecaptchaV2Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public class RecaptchaV2Data
public string Secret { get; set; }

/// <summary>
/// Gets or sets the Response property. This property indicates that this is the response returned from the server.
/// Gets the Response property. This property indicates that this is the response returned from the server.
/// </summary>
public string Response
{
get { return HttpContext.Current.Request.Form["g-recaptcha-response"]; }
}

/// <summary>
/// Gets or sets the RemoteIp property. This property indicates that this is remote ip address from the client.
/// Gets the RemoteIp property. This property indicates that this is remote ip address from the client.
/// </summary>
public string RemoteIp
{
Expand Down
Binary file modified GoogleRecaptcha/bin/Debug/GoogleRecaptcha.dll
Binary file not shown.
Binary file modified GoogleRecaptcha/bin/Debug/GoogleRecaptcha.pdb
Binary file not shown.
Binary file modified GoogleRecaptcha/obj/Debug/GoogleRecaptcha.dll
Binary file not shown.
Binary file modified GoogleRecaptcha/obj/Debug/GoogleRecaptcha.pdb
Binary file not shown.
Binary file modified GoogleRecaptchaMvc/bin/Debug/GoogleRecaptchaMvc.dll
Binary file not shown.
Binary file modified GoogleRecaptchaMvc/bin/Debug/GoogleRecaptchaMvc.pdb
Binary file not shown.
Binary file modified GoogleRecaptchaMvc/obj/Debug/GoogleRecaptchaMvc.dll
Binary file not shown.
Binary file modified GoogleRecaptchaMvc/obj/Debug/GoogleRecaptchaMvc.pdb
Binary file not shown.
28 changes: 26 additions & 2 deletions GoogleRecaptchaWebForms/RecaptchaV2Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,33 @@ public void Validate()
new RecaptchaV2Data() { Secret = SecretKey });
var result = recaptcha.Verify();
IsValid = result.Success;
if(!IsValid && result.ErrorCodes.Length > 0)
if (IsValid) return;
if(result.ErrorCodes.Length > 0)
{
ErrorMessage = result.ErrorCodes[0];
ErrorMessage = String.Empty;
foreach (var errorCode in result.ErrorCodes)
{
switch (errorCode)
{
case "missing-input-secret":
ErrorMessage += "The secret parameter is missing - ";
break;
case "invalid-input-secret":
ErrorMessage += "The secret parameter is invalid or malformed - ";
break;
case "missing-input-response":
ErrorMessage += "The response parameter is missing - ";
break;
case "invalid-input-response":
ErrorMessage += "The response parameter is invalid or malformed - ";
break;
}
ErrorMessage = ErrorMessage.TrimEnd(' ', '-');
}
}
else
{
ErrorMessage = "Oops! Unknown error!";
}
}
}
Expand Down
Binary file modified GoogleRecaptchaWebForms/bin/Debug/GoogleRecaptcha.dll
Binary file not shown.
Binary file modified GoogleRecaptchaWebForms/bin/Debug/GoogleRecaptcha.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit a3a23c3

Please sign in to comment.