Skip to content
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

Add hCaptcha backend as an alternative to reCAPTCHA #2312

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jazzzny
Copy link

@Jazzzny Jazzzny commented Jan 20, 2024

Screenshot 2024-01-20 at 4 57 08 PM

This PR adds support for an hCaptcha backend powered by django-hcaptcha-field. Most additions are duplicated from the existing reCAPTCHA backend as the hCaptcha package is very similar.

See https://blog.cloudflare.com/moving-from-recaptcha-to-hcaptcha for possible benefits over reCAPTCHA.

Copy link
Member

@Xyene Xyene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. The idea of using hCaptcha as an alternate backend seems good to me, especially given how easy this looks to support.

@@ -34,7 +35,10 @@ class CustomRegistrationForm(RegistrationForm):
newsletter = forms.BooleanField(label=_('Subscribe to newsletter?'), initial=True, required=False)

if ReCaptchaField is not None:
captcha = ReCaptchaField(widget=ReCaptchaWidget())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than having this and then needing to have duplicated blocks in the template, could we keep calling this captcha, and only do the hcaptcha thing in an else branch?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for letting this go mouldy, I'll get this done soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants