Comments (17)
The errors simply switches from 403 to page not found, since the server tries to load this address:
https://sale.colombomilano1911.com/index.php?p=actions/users/send-password-reset-email&GOOGLE_STRING
@masiorama Just tested on your site, and I get a 404 response from
https://sale.colombomilano1911.com/index.php?p=actions/users/send-password-reset-email
, not a 403. (And no Google-added query string params in the URL.)
Sorry, I didn't mention: you have to accept cookies to switch GA tracking on (due to GDPR here in Italy).
I just tested your code snippet locally, and the
users/send-password-reset-email
action is called successfully. So I’m guessing this is a server misconfiguration issue somehow. Not totally sure what to look at, though.
Does the form work locally for you?
Well, your simple question pointed me to this: since locally (dev env) I do not include tracking scripts I am not sure, so I will turn it on and debug. I thought, as you do, that the problem is server misconfiguration so it didn't come to my mind, but I will check on dev env just to confirm that theory.
Thanks, I will keep you posted.
from cms.
Rather than using a nested action
param within your form, can you try setting the form’s action
argument to {{ actionUrl('controller/path') }}
?
from cms.
Hi Brad,
I've tried this, but it doesn't fix the problem. Any other ideas?
from cms.
Hm, that’s surprising. What happens?
from cms.
I'm still getting /[Object HTMLInputElement]?GOOGLE_STRING
I tested it with a "user/login" form. It doesn't work then.
<form method="post" class="checkout-form needs-validation" accept-charset="UTF-8">
{{ csrfInput() }}
<input type="hidden" name="action" value="{{ actionUrl('users/login') }}">
{{ redirectInput(CHECKOUT_ADDRESS_URL) }}
from cms.
Sorry, that’s not what I meant. I’m saying remove the action
input, and use an action
param on the <form>
element instead:
<form method="post" class="checkout-form needs-validation" accept-charset="UTF-8"
action="{{ actionUrl('users/login') }}"
>
{{ csrfInput() }}
{{ redirectInput(CHECKOUT_ADDRESS_URL) }}
from cms.
Hi Brandon,
sorry for the late reply, but this works. Thanks!
from cms.
Sweet, glad to hear!
from cms.
This is an issue for me on Craft 5 too... @brandonkelly what you suggested is not working for me, I switched password reset form from
<form method="post" accept-charset="UTF-8">
{{ csrfInput() }}
{{ actionInput('users/send-password-reset-email') }}
{{ redirectInput('shop/customer/sign-in') }}
...
to
<form method="post" accept-charset="UTF-8" action="{{ actionUrl('users/send-password-reset-email') }}">
{{ csrfInput() }}
{{ redirectInput('shop/customer/sign-in') }}
...
The errors simply switches from 403 to page not found, since the server tries to load this address:
https://sale.colombomilano1911.com/index.php?p=actions/users/send-password-reset-email&GOOGLE_STRING
You can test it here: https://sale.colombomilano1911.com/shop/customer/forgot-password
No need to fill the input text.
from cms.
Any suggestion on this? I'm kinda lost on how to handle this thing, if it's related to some bug on craft or if the matter is totally guilt of GA.
from cms.
I just tested that locally and it worked, so I’m guessing it’s more of a server configuration issue.
The errors simply switches from 403 to page not found, since the server tries to load this address:
https://sale.colombomilano1911.com/index.php?p=actions/users/send-password-reset-email&GOOGLE_STRING
@masiorama Just tested on your site, and I get a 404 response from https://sale.colombomilano1911.com/index.php?p=actions/users/send-password-reset-email
, not a 403. (And no Google-added query string params in the URL.)
I just tested your code snippet locally, and the users/send-password-reset-email
action is called successfully. So I’m guessing this is a server misconfiguration issue somehow. Not totally sure what to look at, though.
from cms.
Does the form work locally for you?
from cms.
Hi @brandonkelly sorry for the delay, hectic days recently.
I will work in the next couple of days and keep you posted.
from cms.
@brandonkelly I get the same behavior on local dev.
I'm totally lost on this and indeed I keep getting 404.
To reproduce the scenario on prod env:
- access this url: https://sale.colombomilano1911.com/shop/customer/sign-in
- on the cookie banner, click
Rifiuta tutto
(reject all
) - click on link "Password dimenticata?" (Forgot password?) you should be getting the url with google tracking appended (otherwise the test is not worth it)
- then click on "Invia" to send the form empty
In this scenario you should get the 404, as this are not working (without google tracking we get .
The problem is that the url in the address bar is https://sale.colombomilano1911.com/index.php?p=actions/users/send-password-reset-email&_gl...
- If you remove the
&gl...
stuff you get a "Ops post request required" error in place of the 404, which is compliant with what you should expect targeting that url on the address bar as a get request.
So the point is that with that google stuff appended on the url Craft is not able to correctly read the route, am I right?
I have no clue if my hypotesis could be right or even if I was able to explain my idea in proper english.
Hope this whole rant makes sense somehow, since I'm stuck with a project I should have published 1 month ago :(
Thanks for any hint/help/idea.
from cms.
Hello, sorry to bother @brandonkelly any thoughts on this? Just to point me to the right direction (more exclude an option).
from cms.
@masiorama Just got around to looking into that again.
I’m not sure exactly what the problem is, but it’s not with the _gl
query string param.
You can verify by opening your Network tab, then submitting the form, then inspecting the 404 request, and creating a new POST
request to the same URL sans-_gl
param, and the same form data, from your console:
fetch('https://sale.colombomilano1911.com/index.php?p=actions/users/send-password-reset-email', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
CRAFT_CSRF_TOKEN: '...',
redirect: '...',
loginName: '[email protected]'
})
})
When you submit it, you’ll get the same 404 response back.
So something on your server isn’t handling POST requests to action URLs properly, it seems.
from cms.
Thenks @brandonkelly I will dig into it and keep you posted.
from cms.
Related Issues (20)
- [5.x]: editableTable error "Uncaught No disclosure container found." HOT 3
- [4.x]: Can't save matrix field because (almost) all asset fields are erroring – without displaying an error HOT 2
- [5.x]: Graphql - Filter elements depending on nested field in matrix field HOT 1
- [5.x]: Link Field doesn't allow Singles to be selected as allowed link types HOT 6
- [5.x]: "City" field in address slideout is incorrectly labelled/populated for UK addresses HOT 5
- [5.x]: `EVENT_DEFINE_ACTION_MENU_ITEMS` gives TypeError HOT 1
- [5.x]: Table Field Not Escaping HTML in Column Header HOT 2
- [5.x]: Upgrading from 4 -> 5 failed to apply m240302_212719_solo_preview_targets HOT 1
- [5.x]: GraphQL introspection schema gets larger after merging entries HOT 1
- [4.x]: Upgrade jquery-ui to 1.13.<latest> or better 1.14 (newest) HOT 4
- [4.x|5.x]: Fresh install of project with plugins in project config fails HOT 5
- [5.x]: 'image' and 'links' handle for a field doesn't render the output. Looks to be a reserved handle? HOT 4
- [5.x]: Unable to Input Negative Values in Money Field and Inconsistent Minimum/Maximum Value Display HOT 2
- [5.x]: GraphQL product image format WebP not working HOT 1
- [5.x]: Entry field queries returning _all entries_ if the `id()` param is used to exclude entry IDs HOT 3
- [5.x]: Can't delete entry in matrix field with view mode cards HOT 1
- [5.x]: Link field URL will no longer accept a root-relative string. HOT 3
- [5.x]: Illegal offset type getPreviewHtml country field HOT 1
- [5.x]: Cache includes links with x-craft-live-preview in query params HOT 2
- [4.11.4]: Cannot create new users HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cms.