How to use the react-native-config.PIN_KEY function in react-native-config

To help you get started, we’ve selected a few react-native-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esteemapp / esteem-mobile / src / screens / pinCode / container / pinCodeContainer.js View on Github external
_setPinCode = async (pin, isReset) => {
    const { intl, currentAccount, applicationPinCode } = this.props;
    const { isExistUser, pinCode } = this.state;

    const realmData = getUserDataWithUsername(currentAccount.name);
    const userData = realmData[0];

    // For exist users
    if (isReset) {
      await this._resetPinCode(pin);
      return true;
    }
    if (isExistUser) {
      if (!userData.accessToken && !userData.masterKey && applicationPinCode) {
        const verifiedPin = decryptKey(applicationPinCode, Config.PIN_KEY);
        if (verifiedPin === pin) {
          await this._setFirstPinCode(pin);
        } else {
          Alert.alert(
            intl.formatMessage({
              id: 'alert.warning',
            }),
            intl.formatMessage({
              id: 'alert.invalid_pincode',
            }),
          );
        }
      } else {
        await this._verifyPinCode(pin);
      }
      return true;
github esteemapp / esteem-mobile / src / screens / settings / container / settingsContainer.js View on Github external
_setDefaultPinCode = action => {
    const { dispatch, username, currentAccount, pinCode } = this.props;

    if (!action) {
      const oldPinCode = decryptKey(pinCode, Config.PIN_KEY);
      const pinData = {
        pinCode: Config.DEFAULT_PIN,
        username,
        oldPinCode,
      };
      updatePinCode(pinData).then(response => {
        const _currentAccount = currentAccount;
        _currentAccount.local = response;

        dispatch(updateCurrentAccount({ ..._currentAccount }));

        const encryptedPin = encryptKey(Config.DEFAULT_PIN, Config.PIN_KEY);
        dispatch(savePinCode(encryptedPin));

        setPinCodeOpen(action);
        dispatch(isPinCodeOpen(action));
github esteemapp / esteem-mobile / src / screens / pinCode / container / pinCodeContainer.js View on Github external
_savePinCode = pin => {
    const { dispatch } = this.props;
    const encryptedPin = encryptKey(pin, Config.PIN_KEY);
    dispatch(savePinCode(encryptedPin));
  };
github esteemapp / esteem-mobile / src / providers / steem / dsteem.js View on Github external
export const getDigitPinCode = pin => decryptKey(pin, Config.PIN_KEY);