I'm stuck on something and need some advice. I have a frontend login form where I need to dynamically change the redirect input value with JS when it changes. The page has instantsearch in place and I am trying to get the most current URL when a user interacts with the facets. I have a "save your search" setup in place but I have to have the user signed in to do this. I want them to be able to log in with my login form, and then return to the same URL. No matter what I have tried I cannot get Craft to validate the hashed return URL. Currently, I have JS in place that grabs the current URL, encodes it, and passes it as a param to a non-cached route via Ajax that renders a template where I am using the Craft filter |hash on the URL param, and parsing it out, then using that to update the form redirect param. However, it still won't pass validation in Craft and renders a 400 each time.

1 Answer 1


I got this working. I refactored my logic to use craft's {{ redirectInput(urlParam) }} instead of writing out my redirect param that seemed to properly generate the hashed return URL and pass the validation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.