Permalink
Browse files

Do a check to make sure the public and private key are filled in corr…

…ectly.
  • Loading branch information...
1 parent e46d544 commit ba05421b6ff5a58e6f5617a288232f649917980a @justingit committed Jan 12, 2017
Showing with 14 additions and 2 deletions.
  1. +14 −2 dada/DADA/App/Guts.pm
View
@@ -3087,12 +3087,24 @@ sub can_use_Google_reCAPTCHA {
try {
require DADA::Security::AuthenCAPTCHA::Google_reCAPTCHA;
$can_use_captcha = 1;
- }
- catch {
+ } catch {
carp "CAPTCHA Not working correctly?:" . $_
if $t;
$can_use_captcha = 0;
};
+
+ if($can_use_captcha == 1) {
+ if(
+ length($DADA::Config::RECAPTCHA_PARAMS{public_key}) <= 0
+ || length($DADA::Config::RECAPTCHA_PARAMS{private_key}) <= 0
+ ){
+ warn '$DADA::Config::RECAPTCHA_PARAMS are not set up correctly'
+ if $t;
+
+ $can_use_captcha = 0;
+ }
+ }
+
return $can_use_captcha;
}

0 comments on commit ba05421

Please sign in to comment.