Skip to content

Commit ef45d94

Browse files
committed
Hope finally fixed the recaptcha :P
1 parent 5828c1c commit ef45d94

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

web_programming/recaptcha_verification/recaptcha_v2_verification.pl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ sub is_valid_captcha {
4040
return 0;
4141
}
4242
}
43-
44-
# Connection to reCAPTCHA failed
45-
return 0;
43+
else {
44+
# Connection to reCAPTCHA failed
45+
return 0;
46+
}
4647
}
4748

4849
# https://docs.mojolicious.org/Mojolicious/Lite#Helpers
@@ -53,15 +54,19 @@ sub is_valid_captcha {
5354
if (($c->param('username') eq 'admin') && ($c->param('password') eq 'admin')) {
5455
return 1;
5556
}
56-
return 0;
57+
else {
58+
return 0;
59+
}
5760
};
5861

5962
helper verify_captcha => sub {
6063
my $c = shift;
6164
if (is_valid_captcha($c)) {
6265
return 1;
6366
}
64-
return 0;
67+
else {
68+
return 0;
69+
}
6570
};
6671

6772
helper ua => sub {

web_programming/recaptcha_verification/recaptcha_v3_verification.pl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use warnings;
1919
use Mojolicious::Lite;
2020
use Mojo::UserAgent;
21-
use Data::Dumper;
2221

2322
# Add your 'Secret Key' here
2423
$ENV{'CAPTCHA_V3_SECRET_KEY'} = "";
@@ -46,9 +45,10 @@ sub is_valid_captcha {
4645
return 0;
4746
}
4847
}
49-
50-
# Connection to reCAPTCHA failed
51-
return 0;
48+
else {
49+
# Connection to reCAPTCHA failed
50+
return 0;
51+
}
5252
}
5353

5454
# https://docs.mojolicious.org/Mojolicious/Lite#Helpers
@@ -59,7 +59,9 @@ sub is_valid_captcha {
5959
if (($c->param('username') eq 'admin') && ($c->param('password') eq 'admin')) {
6060
return 1;
6161
}
62-
return 0;
62+
else {
63+
return 0;
64+
}
6365
};
6466

6567
helper ua => sub {

0 commit comments

Comments
 (0)