Im confused in the best place to store logged in user details in a React / Redux application so that I would have access to the likes of first name and last name in the header on every route.
I have the user api key (JWT) stored in localStorage, but I see it is bad practice to store the likes of first name, last name, email etc in localStorage, due to XSS vulnerabilities.
I would prefer not to hit an API on every route just to return the same user details.
I tried storing them in a redux store as session.user, which gets unset when I do a page refresh or change the URL manually. (store is maintained when changing the route via redux saga push)
How can I store first name, last name etc to be used across multiple routes and on page refresh?