phoenix_live_view icon indicating copy to clipboard operation
phoenix_live_view copied to clipboard

Send referring URL on live redirect as param

Open chrismccord opened this issue 3 years ago • 4 comments

chrismccord avatar Dec 07 '21 16:12 chrismccord

question: Would it make sense to send the referrer in connect_params?

I ask because historically params have been for path params, query params, and body params. Given that we send the connect params on each join, I wondered if it might make sense to inject the url on live redirect and use Document.referrer on the initial join.

mcrumm avatar Dec 07 '21 17:12 mcrumm

Referrer is trickier because we may want to use it in both live_redirect and live_patch? 🤔

josevalim avatar Dec 07 '21 17:12 josevalim

Good point! Any concerns about clobbering user-land params? Maybe we call it __referrer or something to attempt to avoid collisions?

mcrumm avatar Dec 08 '21 17:12 mcrumm

Yeah we'll underscore it like _target and document

chrismccord avatar Dec 08 '21 17:12 chrismccord

Already implemented some time ago as _live_referer

chrismccord avatar Jul 18 '23 00:07 chrismccord