Skip to content

Instantly share code, notes, and snippets.

@Maxim-Kolmogorov
Created May 19, 2020 05:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Maxim-Kolmogorov/bee042a17a61e6d5b74362df0c06911f to your computer and use it in GitHub Desktop.
The first implementation option for the article: https://kolmogorov.pro/integration_google_recaptcha_v3_in_site_on_vue_js
<script src="https://www.google.com/recaptcha/api.js?render=ВАШ_КЛЮЧ"></script>
<script>
grecaptcha.ready(function() {
grecaptcha.execute('ВАШ_КЛЮЧ', {action: 'homepage'}).then(function(token) {
let json = JSON.stringify({
token: token
});
let xhr = new XMLHttpRequest();
xhr.open('POST', '/functions/recaptcha.php', false);
xhr.send(json);
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment