-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any plan to support Invisible ReCaptcha? #281
Comments
Looks like the only change is placing the attributes on a button instead of a div. If you'd like to add an |
@davidism It seems out of beta now. |
@ar-anvd @RabsRincon I'd be happy to review a PR if you're still interested. |
We started using the Invisible ReCaptcha a while back without having to do any major modifications to our codebase. flask configuration RECAPTCHA_DATA_ATTRS = {'bind': 'recaptcha-submit', 'callback': 'onSubmitCallback', 'size': 'invisible'} controllers.py from flask_wtf.recaptcha.fields import RecaptchaField
from wtforms.fields.core import StringField
class TestForm(FlaskForm):
the_input = StringField('Write stuff here...')
recaptcha = RecaptchaField()
@bp.route('/test', methods=['GET', 'POST'])
def test():
form = TestForm()
if form.validate_on_submit():
print('everything a-ok')
else:
print(form.errors)
return render_template('test.html', form=form) test.html <html>
<head></head>
<body>
<script>
function onSubmitCallback(token) {
document.getElementById("test-form").submit();
}
</script>
<form id="test-form" action="" method="post">
{{ form.the_input }}
{{ form.recaptcha }}
<button id="recaptcha-submit">
Test me
</button>
</form>
</body>
</html> |
I don't think the method that @mazzer shared still works. Is there a better way to set this up? |
It still worked for me last week, haven't tried today. Any particular reason why you say it now doesn't work? |
@fili I used the above code for invisible captcha and I get "urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>" on "form.validate_on_submit" Edit: |
@nullbaka Are you using reCaptcha v2: Invisible reCAPTCHA badge? This one works with @mazzer example. I am not sure where that certificate error comes from, may be related to something else or maybe v3. |
@fili yes am using invisible reCAPTCHA on Mac OSX Catalina. I googled the error and found that this issue can be fixed by installing certificates.command. Didn't find any relation to Recaptcha or form validation. All's working good now. Let's see if I face any issues on deployment. |
Is Invisible ReCaptcha support planned? Would PR with support for it be welcomed?
The text was updated successfully, but these errors were encountered: