If a user logs in with user and password, he gets an new api key, so react can access the Rest Api with his user account. How do you save this api key? And what happend if the user clicks 'refresh page'?
Of course I can initalize the Rest App every time with
<script>
window.REP_LOG_API_KEY = '19e8317a38b24af82da056f6ed36e831ea6b8f9bfcad996aaa56ec773f9f2e1d';
</script>
<script src="build/reactapp.js"></script>
but dont look very secure (but I like the idea of changing this key every page request, if you have no single page application and react is only used here and there).
To store the Api Key in a cookie would be also possible (secure but not httponly, normally I only use safe cookies). Is this the only way?
I'm still not quite sure how to use react with a rest api with individual api keys. Thany you.