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

Treat empty SITE_KEY as error #239

Merged
merged 2 commits into from
Apr 3, 2020

Conversation

minusf
Copy link
Contributor

@minusf minusf commented Apr 3, 2020

Recently I had a configuration error where the SITE_KEY remained unset and the empty defaults made the widget render without the captcha and subsequently fail every submission. While the form showed a validation error, it's not user friendly, and it took days until someone reported it. Lack of logging made tracking down this issue needlessly long as well. When this widget is required, having an empty SITE_KEY and/or SITE_SECRET is simply an error and should be handled as such.

While here, simplify the widget and add the SITE_KEY as the hidden input field's value= instead of creating a free floating <script> tag with a single variable. Use a custom data- field to make selection easy. TBH I think for this widget both label (never shown) and name do not make sense: name should just be hard coded, as there will never be more than one captcha in one page and then we could simply rely on name (or id)...

Remove the empty defaults, they dont make sense.
This diff is against 0.16.1

PS. submitFormButton.removeAttr('type'); generates console errors Uncaught Error: type property can't be changed and probably shouldnt be used.

Recently I had a configuration error where the SITE_KEY remained unset
and the empty defaults made the widget render without the captcha and
subsequently fail every submission. While the form showed a validation
error, it took days until someone reported it.  Lack of logging made
tracking down this issue needlessly long as well.  When this widget is
required, having an empty SITE_KEY and/or SITE_SECRET is simply an error
and should be handled as such.

While here, simplify the widget and add the SITE_KEY as the hidden input
field's value= instead of creating a free floating <script> tag with a
single variable...

Remove the empty defaults, they dont make sense.
This diff is against 0.16.1
@barseghyanartur barseghyanartur changed the base branch from master to v0.16.x April 3, 2020 22:32
@barseghyanartur
Copy link
Owner

@minusf:

Thanks for bringing this up. That submitFormButton.removeAttr('type') is probably caused by another browser API change. I'll take a look at it ASAP.

The rest looks OK. I'm merging it into v0.16.x (and then into master).

@barseghyanartur barseghyanartur merged commit d63bae4 into barseghyanartur:v0.16.x Apr 3, 2020
@barseghyanartur
Copy link
Owner

P. S. Release will follow shortly.

@barseghyanartur
Copy link
Owner

Released in 0.16.3.

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