elgerlambert / redux-localstorage

Store enhancer that syncs (a subset) of your Redux store state to localstorage.
MIT License
1.32k stars 107 forks source link

encrypt data? #23

Closed Sly777 closed 8 years ago

Sly777 commented 8 years ago

Hi all,

It works perfectly with react 0.14.1 & redux 3.0.4. I want to encrypt data when i save data to localstorage so user cannot understand whats going on (i hope :). But i couldn't create any enhancer for that. Do you have any tutorial or "template" to create enhancer? I just want to encrypt & decrypt data on set & get actions.

Thanks!

elgerlambert commented 8 years ago

Hi @Sly777,

An issue has been raised with respect to encryption/encoding, see #16. Currently discussing improvements to the API that should also take this issue into account, see #21 - would value your input.

Kind regards.

elgerlambert commented 8 years ago

Hi @Sly777,

The problem before was that JSON (de)serialization was done by the actual storage adapters which (as discussed in #16) could get in the way if you wanted to encrypt your data. This issue has been resolved in 1.0.0-rc5 (you can now access the adapters without serialization), I invite you to have a look at the code snippet shown in the readme under transformState for an encryption example.