How to use the react-native-keychain.resetGenericPassword function in react-native-keychain

To help you get started, we’ve selected a few react-native-keychain 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 oblador / react-native-keychain / test_index.js View on Github external
// $FlowExpectedError - First two arguments are required
setGenericPassword();
setGenericPassword('username', 'password').then(result => {
  (result: boolean);
});
setGenericPassword('username', 'password', 'service');
setGenericPassword('username', 'password', simpleOptions);

getGenericPassword().then(result => {
  (result: boolean | SharedWebCredentials);
});
getGenericPassword('service');
getGenericPassword(simpleOptions);

resetGenericPassword().then(result => {
  (result: boolean);
});
resetGenericPassword('service');
resetGenericPassword(simpleOptions);

requestSharedWebCredentials().then(result => {
  if (result) {
    (result.server: string);
    (result.username: string);
    (result.password: string);
  }
});

setSharedWebCredentials('server', 'username', 'password').then(result => {
  (result: void);
});
github oblador / react-native-keychain / test_index.js View on Github external
(result: boolean);
});
setGenericPassword('username', 'password', 'service');
setGenericPassword('username', 'password', simpleOptions);

getGenericPassword().then(result => {
  (result: boolean | SharedWebCredentials);
});
getGenericPassword('service');
getGenericPassword(simpleOptions);

resetGenericPassword().then(result => {
  (result: boolean);
});
resetGenericPassword('service');
resetGenericPassword(simpleOptions);

requestSharedWebCredentials().then(result => {
  if (result) {
    (result.server: string);
    (result.username: string);
    (result.password: string);
  }
});

setSharedWebCredentials('server', 'username', 'password').then(result => {
  (result: void);
});
github iotaledger / trinity-wallet / src / mobile / __tests__ / utils / keychain.spec.js View on Github external
return keychainWrapper.clear().then(() => {
                expect(keychain.resetGenericPassword).toHaveBeenCalled();
            });
        });
github goldennetwork / golden-wallet-react-native / app / modules / Unlock / UnlockStore.js View on Github external
@action enraseData() {
    Keychain.resetGenericPassword()
    AppDS.enraseData()
      .then(async (res) => {
        this.resetDisable()
        MainStore.appState.resetAppState()
        await AppDS.readAppData()
        this.setup()
        NavStore.pushToScreen('EnraseNotifScreen')
      })
      .catch(e => console.log(e))
  }
github LedgerHQ / ledger-live-mobile / src / screens / Settings / General / PasswordRemove.js View on Github external
async submit() {
    const { confirmPassword } = this.state;
    if (!confirmPassword) return;
    const { disablePrivacy, navigation } = this.props;
    try {
      const credentials = await Keychain.getGenericPassword();
      if (credentials) {
        if (credentials.password !== confirmPassword) {
          Vibration.vibrate(VIBRATION_PATTERN_ERROR);
          throw new PasswordsDontMatchError();
        }
        await Keychain.resetGenericPassword();
      }
      disablePrivacy();
      const n = navigation.dangerouslyGetParent();
      if (n) n.goBack();
    } catch (error) {
      this.setState({ error, confirmPassword: "" });
    }
  }
github mozilla / notes / native / app / actions.js View on Github external
return new Promise((resolve, reject) => {
      browser.runtime.sendMessage({
        action: DISCONNECTED
      });
      dispatch({ type: DISCONNECTED });
      Keychain.resetGenericPassword().then(resolve, reject);
    });
  };
github MetaMask / metamask-mobile / app / core / SecureKeychain.js View on Github external
resetGenericPassword() {
		const options = { service: defaultOptions.service };
		return Keychain.resetGenericPassword(options);
	},
github oblador / react-native-keychain / KeychainExample / App.js View on Github external
async reset() {
    try {
      await Keychain.resetGenericPassword();
      this.setState({
        status: 'Credentials Reset!',
        username: '',
        password: '',
      });
    } catch (err) {
      this.setState({ status: 'Could not reset credentials, ' + err });
    }
  }