google_recaptcha_validate
v1.0.1
Published
Validate a received google recaptcha token to secure http post forgery
Downloads
2
Readme
google_recaptcha_validate
google_recaptcha_validate is an extremely simple module that calls https://www.google.com/recaptcha/api/siteverify?secret=yoursecret&response=responsestring&remoteip=useripaddress to verify a users recaptcha token.
Example usage:
const recaptcha_validate = require('google_recaptcha_validate')('your_google_recaptcha_secret');
const isTokenValid = async(userIp, recaptchaToken) => {
const res = await recaptcha_validate(userIp, recaptchaToken);
if(res.success){
return true;
}
console.log(res["error-codes"]);
return false;
}