I have 2 components/pages. One is the login page and one is the user customization page. I want the user customization page to be token authorized so you can only see it after you login.
I am using a Django + React setup with Django Knox being used as the authorization tokens.
I now have a workflow using this.props that passes the token from the login component to the main app.js and then to the user customization component. But I guess during the routing/switching between pages, my token is lost. How do I maintain this token?
So, basically trying to persist your token, without having to refetch it when (for example) the page is reloaded or, as you mentioned, when navigating between different pages in your application.
There are various ways to store the token, without much work, one such example being
sessionStorage
With plain JS:
sessionStorage
localStorage
cookies
With additional libraries for state management, although this requires more work, and is not necessary to fix your issue.
Redux
Apollo
(assumes you're using GraphQL)