invisible_captcha icon indicating copy to clipboard operation
invisible_captcha copied to clipboard

IP spinner validation when forms are added with JS

Open testa19 opened this issue 3 years ago • 1 comments

If there had been a form on a page (comment form, for example) and the same form is loaded again (reply on a comment) the spinner validation fails for "older" form as session[:invisible_captcha_spinner] is being reset

if InvisibleCaptcha.spinner_enabled && @captcha_ocurrences == 1
  session[:invisible_captcha_spinner] = InvisibleCaptcha.encode("#{session[:invisible_captcha_timestamp]}-#{current_request.remote_ip}")
end

testa19 avatar Jul 06 '22 09:07 testa19

You're right, adding forms with JS doesn't currently play well with this gem. Happy to discuss any implementation ideas 🤘🏼

I'm using this gem in production in several apps, for years, with great success, but to be honest, I'm using it in (public) pages like: sign-up, contact form, request demo, ... where usually you would find a visible captcha, but I've never used it in that kind of "interactive" (and with a logged user) pages with different forms, comments, ...

markets avatar Jul 06 '22 22:07 markets