Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

encrypted storage wrapper for web application #61

Open
cederom opened this issue Aug 13, 2021 · 3 comments
Open

encrypted storage wrapper for web application #61

cederom opened this issue Aug 13, 2021 · 3 comments

Comments

@cederom
Copy link

cederom commented Aug 13, 2021

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

@o-az
Copy link

o-az commented Jan 27, 2022

That would be fantastic.

@avinashbarfa-buku
Copy link

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. 

@emeraldsanto
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants