matthutchinson / acts_as_textcaptcha

Text-based logic question captcha's for Rails 🚫🤖

Home Page:https://acts-as-textcaptcha.hiddenloop.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

one captcha per session instead of page reload

opened this issue · comments

Hi,

using textcaptcha and my users love it, especially since recaptcha became unreadable.
Also the custom captchas are great as I can tailor the questions to suit my audience.

However my biggest gripe with this gem is that if a user opens a second page that has a textcaptcha, the possible answers get overwritten in the session and doesn't match the answer on the tab that was opened first.
Ideally either the form would contain a reference to the question so that the answer can be matched to the right question,
or the question should always be the same for the duration of the session or until the user has answered a question.

Btw, I doublechecked with the demo on heroku and it has the same behaviour. So I'm not sure if this is a bug or a feature request. :)

Or maybe I just don't know how to do it?

Well spotted, I'll get to work on a fix asap.

I've taken this bug as an opportunity to rewrite the internals of this gem and release an enitrely new version (3.0). It is still work in progress but I will have a release out soon. It fixes this issue, has a cleaner implementation, will work without using sessions and on both Rails 2 and 3+. With all these changes, existing gem users will have to change the way they hook their controller/view code to use the gem, but I'll drop a 'How to upgrade' note in the new README to explain everything.

New v3.0 version fixes this issue.

Session is no longer used for storing answers, they are now always encrypted and sent via hidden fields with form submission.

V3.0 means slightly different configuration instructions for your controller/view, so please check the new README for all the details.