简体   繁体   中英

How to make react redux state information unavailable on dev tools?

I am working on a react application, with the react-redux state. Everything works fine with the redux state, but the only issue is that the redux state is stored in local storage and I want to disable it for other people to view it.

Since it is in development it is fine, but when it is in production, it will become an issue to show sensitive information to general users.

Is there a way to disable the redux state information on the dev tools for others or some other way to solve this issue?

Do check the screen shot attached

开发控制台截图

You cannot hide local storage data from the user, whether that comes from Redux or otherwise. You could possibly obfuscate it, but as the client code contains the means to deobfuscate it would be fairly simple to reverse. Also, the data will still be presumably sent over the nerwork, which is easy to intercept.

If your design requires data to be persisted on the client that cannot be exposed to the user and cannot be expired, I would suggest you rethink your design. Note that even with obfuscation any kind of XSS attack will possibly have an opportunity to snoop on heap values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM