Commit Graph

9 Commits

Author SHA1 Message Date
Jan Jakes
71d7f46718 Make captcha session stateless
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
Jan Jakes
e8cf3d61ef Make captcha phrase stateless
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
Jan Jakes
10ef9ffce5 Initialize CAPTCHA session and phrase on page load
Previously, a new CAPTCHA phrase was generated when the CAPTCHA image
or audio was requested "again". For that, a counter needed to be stored in the
session, and since image and audio were fetched in parallel, any of them could
initialize the new CAPTCHA phrase. The problem appeared when they both
generated a new phrase at the same time. This resulted in a race condition,
where the image and audio had different CAPTCHA phrases and some users
weren't able to pass the CAPTCHA at all. This was occuring especially in Safari,
(maybe somehow due the type dectection range "preflight" request).

Now, the phrase is initialized on the CAPTCHA page load (and reloaded via AJAX),
so we don't need to store any additional metadata, apart from the phrase itself.

[MAILPOET-6038]x
2024-08-05 13:28:52 +02:00
David Remer
118cc83cc2 Remove 'Click to refresh' in title because a click does no longer refresh
[MAILPOET-5032]
2023-02-08 13:08:09 +01:00
 Ján Mikláš
650d730c3f Fix lowercased captcha on built-in CAPTCHA buttons
[MAILPOET-4915]
2022-12-16 14:27:49 +01:00
Jan Jakes
926620e8f8 Ignore strict types rule in all existing files that don't have it
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
David Remer
86076547c3 Raise aria-live level
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
4832771185 Refactor the captcha system
The current Captcha class has a lot of responsibilities. It renders the captcha
image, can check if a certain captcha type is a Google captcha, if a captcha is
required for a certain email. The SubscriberSubscribeController is not only in
charge of "controlling" the subscription process but also validates, whether a
captcha is correct or not. This architecture made it difficult to extend the
functionality and introduce the audio captcha feature.

Therefore this commit refactors the captcha architecture and tries to seperate
the different concerns into several classes and objects. Validation is now done
by validators.

The CaptchaPhrase now is in charge of keeping the captcha phrase consistent
between the image and the new audio, so that you can renew the captcha and both
captchas are in sync.

[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
David Remer
7fb8d64628 Rename CaptchaRenderer to CaptchaFormRenderer
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00