I'm developing a site in Gatsby. Users receive an email with a link containing a single-use token, like this:
https://www.example.com/approval?token=hIPdI7oSw6KV6k8ttsXG3XAHmIqExyB01YkChxiLR9leksJ67iRme6yyxfBztz3Z
This should take them to the approval page and supply the token as parameter.
It works fine in the development build, but in the production build the parameter is missing from the url and the user is simply directed to https://www.example.com/approval
Does anyone know why Gatsby might be re-writing the url without the parameter in the production build, and is there some way to prevent that from happening?
EDIT: This site is hosted on CloudFront, and we've enabled forwarding of query params. Possibly there are some a re-direct happening at another level?
It turned out to be Gatsby/CloudFront madness: https://github.com/gatsbyjs/gatsby/issues/20139
The Gatsby dev server was unhelpfully injecting a / in front of the ?. The production build on CloudFront wasn't doing that, triggering a re-direct. CloudFront requires query strings in the format /? - for future reference!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With