Motivation
Storing the token as a URI param will make it much more manageable and easier to access (React Router / Remix has a hook useSearchParams that can do just that) throughout the app rather than relying on local storage.
Technical Design
When a new session is created, store the ID as a parameter. Retrieving it is as easy as calling a hook within components, and React Router / Remix data loaders already allow for easy access to the URL and params.
Motivation Storing the token as a URI param will make it much more manageable and easier to access (React Router / Remix has a hook
useSearchParams
that can do just that) throughout the app rather than relying on local storage.Technical Design When a new session is created, store the ID as a parameter. Retrieving it is as easy as calling a hook within components, and React Router / Remix data loaders already allow for easy access to the URL and params.
Alternatives to Consider Keep it in local storage
Additional context Suggested by @tobitege