Closed oriharel closed 6 years ago
Managed using Serializr
@oriharel I have similar requirement, how you manage to do that?
I believe @blankg can add a code snippet
@ararog, missed this mention but here is the code snippet anyway:
import { createModelSchema, custom } from "serializr";
class User { @persist @observable username = ""; }
createModelSchema(User, { username: custom(encryptString, decryptString) });
I'd like my data to be encrypted when persisted. What would you suggest as a best practice for that? suppose I'll take care of the encrypting key generation and the algorithm - where would be the best place to perform such an action in the flow? My case is in React Native.