N
Nuxt9mo ago
Bread

Prevent routing to a redirection

I have a product page /holidays/grand-canyon and when hitting a CTA (nuxt-link) the user is sent to an interstitional route provided by an API /basket?holidayCode=1234 this then redirects to the correct 'step' in the journey to purchase, ie. /basket/extras if the holiday has any extras available for purchase. When on this first page in the purchase journey, if you hit the back button in the browser you are taken to the redirection step (/basket?holidayCode=1234) which then puts you right back where you started. How can I prevent this? pseduo diag: Desired: PDP ⇨ Book ⇨ Basket Step [back]⇨ PDP Actual: PDP ⇨ Book ⇨ Basket Step [back]⇨ Book ⇨ Basket Step
2 Replies
Bread
BreadOP9mo ago
I've tried GPT'ing this, and it suggest using localstorage to store the PDP url and then hook into popstate which feels...smelly. But smelly might be the only way?
owljackob
owljackob9mo ago
Middleware?
Want results from more Discord servers?
Add your server