How to store redux store to localstorage and get it when page refreshed
The issue where the page refresh causes an automatic logout typically occurs because the token is not being persisted across page reloads. in react redux How can i fix it?
2 Replies
Medium
Here’s Why Storing JWT in Local Storage is a Disastrous Mistake
You are probably doing this, so please stop!!
like @b1mind said, it's not recommended to store JWT in local storage, but if you have to just check for your token within local storage before initializing your state, if it does exist set it as the initial value of state in your redux slice