File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
web_programming/recaptcha_verification Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 2020use Mojo::UserAgent;
2121
2222# Add your 'Secret Key' here
23- $ENV {' CAPTCHA_V2_SECRET_KEY' } = " 6LeYxBsaAAAAADckp07ST4i2KTU3--4mPFVEinLE " ;
23+ $ENV {' CAPTCHA_V2_SECRET_KEY' } = " " ;
2424
2525sub is_valid_captcha {
2626 my ($c ) = @_ ;
@@ -66,9 +66,7 @@ sub is_valid_captcha {
6666
6767helper ua => sub {
6868 my $ua = Mojo::UserAgent-> new;
69- $ua -> transactor-> name(
70- ' Mozilla/5.0 (Windows NT 6.1; WOW64; rv:77.0) Gecko/20190101 Firefox/77.0' );
71- $ua -> insecure(1);
69+ $ua -> transactor-> name(' Mozilla/5.0 (Windows NT 6.1; WOW64; rv:77.0) Gecko/20190101 Firefox/77.0' );
7270 return $ua ;
7371};
7472
@@ -119,7 +117,6 @@ sub is_valid_captcha {
119117@@ index.html.ep
120118<html>
121119 <head>
122- <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
123120 <script src="https://www.google.com/recaptcha/api.js" async defer></script>
124121 </head>
125122 <body>
@@ -134,7 +131,7 @@ sub is_valid_captcha {
134131 <br /><br />
135132 <label>password:</label> <%= password_field 'password' %>
136133 <br /><br />
137- <div class="g-recaptcha" data-sitekey="6LeYxBsaAAAAAEFYISkPQh7t5MptnN0YpkQaVNn6 "></div>
134+ <div class="g-recaptcha" data-sitekey="<Your Site Key> "></div>
138135 %= submit_button 'Log in', id => 'submit'
139136 %= end
140137 </body>
Original file line number Diff line number Diff line change 1818use warnings;
1919use Mojolicious::Lite;
2020use Mojo::UserAgent;
21+ use Data::Dumper;
2122
2223# Add your 'Secret Key' here
2324$ENV {' CAPTCHA_V3_SECRET_KEY' } = " " ;
@@ -119,8 +120,6 @@ sub is_valid_captcha {
119120@@ index.html.ep
120121<html>
121122 <head>
122- <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
123- <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
124123 <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=<Your Site Key>"></script>
125124 </head>
126125 <body>
You can’t perform that action at this time.
0 commit comments