Created
May 19, 2020 05:32
Star
You must be signed in to star a gist
The first implementation option for the article: https://kolmogorov.pro/integration_google_recaptcha_v3_in_site_on_vue_js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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