New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong language for actions/craft-recaptcha-3/default #22
Comments
Thank you for reporting this. I've changed the line to use the current site's URL instead of a relative path. scoreRequest.open("POST", "{{currentSite.baseUrl}}{{ craft.app.config.general.actionTrigger }}/craft-recaptcha-3/default", true); Can you please pull down v1.1.4 and see if it works for you? |
Thanks I see it's going for /fr/ now but I get another error, not sure if it's related, the repcatcha seems to always fail (my secret keep is saved in the settings): the code i'm using is: |
I did change one other line (templates/frontend.twig:32): csrfRequest.open("GET", "{{currentSite.baseUrl}}index.php?p={{ craft.app.config.general.cpTrigger }}/{{ craft.app.config.general.actionTrigger }}/users/session-info&dontExtendSession=1", true); from: csrfRequest.open("GET", "/index.php?p={{ craft.app.config.general.cpTrigger }}/{{ craft.app.config.general.actionTrigger }}/users/session-info&dontExtendSession=1", true); thinking there may be a similar issue with the absolute URL. If you are able to test local changes can you see if it works with the absolute URL for the index.php script? I can change it back if that is the problem but it seems to work correctly for me. Is that a JS console error you posted? |
I tried with both lines (the before/after) and also with the complete direct URL https://xxxx.com/fr/actions/users/session-info&dontExtendSession=1 and it's the same result. Yes its a console error |
Are you sure the front-end script is loading correctly? There is a test for the CSRF token which I believe may be failing. scoreRequest.send('response=' + token + '&{{ craft.app.config.general.csrfTokenName }}=' + csrf); The token is requested from the array_key_exists('response', $request) This conditional is failing which is why you are seeing |
Actually I managed to get a recaptcha success by replacing using the same structure as you used above. If you think it makes sense, could you include it in the next version? |
Okay I think it should be working for you in v1.1.5 Check to make sure the HTTP / HTTPS version is correct also, I saw a similar 400 error when visiting the wrong version. |
great! thank you for your help! |
I get a 404 error because the script is looking at the wrong site (language). The plugin is using
scoreRequest.open("POST", "/{{ craft.app.config.general.actionTrigger }}/craft-recaptcha-3/default", true);
which brings to https://xxxx.com/en/actions/craft-recaptcha-3/default/ instead of https://xxxx.com/fr/actions/craft-recaptcha-3/default/
EN is still installed but disabled as we are only using FR at the moment. FR is already checked as the primary site in the settings... If I manually replace the line with the full FR url, the plugin works fine.
Thank you!
The text was updated successfully, but these errors were encountered: