Problem/Motivation

Hi, I have an issue in which the CAPTCHA module is throwing an error ("Math question field is required") even though the user is not prompted to fill in the Math Question field. This appears on the login screen. Only after attempting to login, does the error message and the Math Question field appear. So, users almost always have to fill in the login form twice.

Previously, the persistence config option was set to:

* Omit challenges on all forms once the user successfully responds to any challenge on the site.

I think I can temporarily resolve this by changing the option to:

* Always add a challenge.
* Omit challenges in a multi-step/preview workflow once the user successfully responds to a challenge.

Nevertheless, it seems the previous option is not working correctly. It's probably remembering that I had successfully answered the challenged in the past, but it fails to accept it again as it has been awhile. If that is the case, then it should show the Math Question field again.

In other words, the error message does not match the presence of the Math Question field. I'm wondering if this is also related to caching?

Thanks for any assistance!

Comments

jasonluttrell created an issue. See original summary.

jasonluttrell’s picture

Issue summary: View changes
jasonluttrell’s picture

Issue summary: View changes
jasonluttrell’s picture

Issue summary: View changes
chrisbele’s picture

In my case the exact same error was appearing and even after the submission the Capatcha didn't show up. It turns out that it was due to an override of the form.html.twig template, which didn't use the {{ element.captcha }}.

anybody’s picture

Version: 8.x-1.1 » 8.x-1.x-dev
Status: Active » Closed (cannot reproduce)

How can this be reproduced with the latest version? I wasn't able to. Perhaps #5 was also the reason in your case @jasonluttrell?

jasonluttrell’s picture

@Anybody - In my case, however, it was in a different twig file (page--simplelogin.html.twig). But sure enough, it does not contain:

{{ element.captcha }}

I have not tested to see if inserting this code fixes the problem, but given that it does not appear to be affecting anyone else (I was using the SimpleLogin module), I'm going to assume this most likely is the cause of the problem.

Thanks,
Jason