react-native-encrypted-storage icon indicating copy to clipboard operation
react-native-encrypted-storage copied to clipboard

encrypted storage wrapper for web application

Open cederom opened this issue 2 years ago • 3 comments

Hello world :-)

I am using RNES for the first time. I know that secure storage is only available on Android and iOS but I am also testing with expo start:web and here it would be really nice to have it working with underlying wrapper directly in react-native-encrypted-storage module. It may leverage browser Password Manager (i.e. [1]) or just simple plaintext store of some sort so it works out of the box :-)

I saw test mocker by @emeraldsanto at [2] but it works only for testing. Manual detection of runtime environment ans switching between AsyncStorage and ReactNativeEncryptedStorage is possible but it would be really nice to have it directly here in this module :-)

[1] https://support.mozilla.org/en-US/kb/password-manager-remember-delete-edit-logins [2] https://github.com/emeraldsanto/react-native-encrypted-storage/blob/master/src/mocks/react-native.js

cederom avatar Aug 13 '21 03:08 cederom

That would be fantastic.

o-az avatar Jan 27 '22 05:01 o-az

I'm developing ios and web app. For storing credentials using encrypted storage, and in web I'm using local storage for now. But at the time of compiling web app throws error.

rnw_blogpost.bundle.js:5540 Uncaught Error: RNEncryptedStorage is undefined at eval (EncryptedStorage.js:1:862) at Object../node_modules/react-native-encrypted-storage/lib/module/EncryptedStorage.js (rnw_blogpost.bundle.js:1766:1) at __webpack_require__ (rnw_blogpost.bundle.js:5537:33) at fn (rnw_blogpost.bundle.js:5736:21) at eval (index.js:1:389) at Object../node_modules/react-native-encrypted-storage/lib/module/index.js (rnw_blogpost.bundle.js:1776:1) at __webpack_require__ (rnw_blogpost.bundle.js:5537:33) at fn (rnw_blogpost.bundle.js:5736:21) at eval (encrypted-storage.ts:1:565) at Object../src/util/encrypted-storage.ts (rnw_blogpost.bundle.js:4098:1)

This is due to https://github.com/emeraldsanto/react-native-encrypted-storage/blob/master/src/EncryptedStorage.ts#L7

Is there any way, that in web I can handle it. 

avinashbarfa-buku avatar Feb 09 '22 04:02 avinashbarfa-buku

I think this is possible with a fairly low amount of user code until we are able to support this natively. See #69.

emeraldsanto avatar Feb 09 '22 15:02 emeraldsanto