add test captcha

This commit is contained in:
Hepatica
2023-12-17 16:15:57 +01:00
parent 0632e374e1
commit 32fce904d4
4 changed files with 758 additions and 152 deletions

View File

@@ -25,8 +25,30 @@
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div class="g-recaptcha" id="rcaptcha" data-callback="get_action" data-sitekey="6LcuUDQpAAAAAPz8007pFD2FigaSh6InnUq_MEd8"></div>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
<script src='https://www.google.com/recaptcha/api.js'></script>
<script>
function get_action(form) {
var v = grecaptcha.getResponse();
console.log(v);
if (v.length == 0) {
document.getElementById('captcha').innerHTML = "You can't leave Captcha Code empty";
return false;
}
else {
document.getElementById('captcha').innerHTML = "Captcha completed";
return true;
}
}
</script>
</html>