Skip to content

Commit

Permalink
More sensible logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
anjackson committed Jun 28, 2023
1 parent 00bcb90 commit 6e60499
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public ModelAndView sendFeedback(@RequestParam(value = "name", required = false)
@RequestParam(value = "email", required = false) String email,
@RequestParam(value = "comments", required = false) String comments,
@RequestParam(value = "g-recaptcha-response", required = true) String gRecaptchaResponse ) {
log.info("sendFeedback got gRecaptchaResponse="+gRecaptchaResponse);

// Check Captcha worked:
this.checkCaptcha(gRecaptchaResponse);
Expand Down Expand Up @@ -117,10 +116,13 @@ public ModelAndView sendNominateRequest(@RequestParam(value = "name", required =
* @return
*/
private boolean checkCaptcha(String gRecaptchaResponse) {
log.info("Validating ReCAPTCHA..." + gRecaptchaResponse.substring(0, 10));
boolean passed = this.isCaptchaValid(this.gRecaptchaSecretKey, gRecaptchaResponse);
if( !passed ) {
log.info("ReCAPTCHA " + gRecaptchaResponse.substring(0, 10) + " failed!");
throw new RuntimeException("ReCAPTCHA Validation Failed!");
}
log.info("ReCAPTCHA " + gRecaptchaResponse.substring(0, 10) + " passed!");
return passed;
}

Expand Down

0 comments on commit 6e60499

Please sign in to comment.