fabianwennink / IconCaptcha-Widget

This repository contains the source for the IconCaptcha client-side widget.
https://www.fabianwennink.nl/projects/IconCaptcha/
MIT License
22 stars 6 forks source link

Issue with validationPath containing parameters #5

Closed bazalt closed 1 year ago

bazalt commented 1 year ago

Hello, This is my first experience with your very interesting solution. So to start with, thank you 👍 ; that's a great job.

I just faced an issue while setting validationPath to something like validation.php?foo=bar (I cannot operate otherwise for reasons intrinsic to a CMS).

In cause, this line in icon-captcha.js, which assumes that validationPath doesn't contain any parameter : https://github.com/fabianwennink/IconCaptcha-Plugin-Front-End/blob/0cb6a19cf74047e69cefb5fd44451eeba0c01f16/src/js/icon-captcha.js#L269

Do you plan to allow such behavior? Thank you.

fabianwennink commented 1 year ago

Hi @bazalt! Thank you for pointing this out to me. I can for sure take this behavior/scenario into consideration. To double check I understand you correctly, the validation URL in your case should be something like this? validation.php?foo=bar&payload=PAYLOAD. I can fairly easily implement this by checking if the options.general.validationPath contain a question mark, and replace the ?payload with a &payload in that case.

bazalt commented 1 year ago

Thanks for your positive feedback.

the validation URL in your case should be something like this? validation.php?foo=bar&payload=PAYLOAD

Exactly.

fabianwennink commented 1 year ago

@bazalt Can you confirm/test your issue has been resolved in this branch: bugfix/validation-path-parameters

bazalt commented 1 year ago

Hi Fabian, This branch fixes the issue, thanks a lot 👍.

fabianwennink commented 1 year ago

The branch has been merged in the main branch. Version 3.1.1 is now the latest release.