oblador / react-native-keychain

:key: Keychain Access for React Native
MIT License
3.12k stars 515 forks source link

this library's resetGenericPassword method is not working #590

Open ceyanesb opened 1 year ago

ceyanesb commented 1 year ago

I am developing an app and I want to clean my credentials when the app is installed for and opened for the first time or when the user logs out.

Every time I login, then uninstall and then install the app again i get the credentials which I shouldn't get.

BraveEvidence commented 1 year ago

This will help https://www.youtube.com/watch?v=J0OSn7s9YiA&list=PLQhQEGkwKZUrempLnmxjt7ZCZJu1W3p2i&index=15

raza-jamil-reckon commented 1 year ago

Seeing the same thing, our logout stopped working all of a sudden and I've tracked it back to resetGenericPassword not doing anything. It returns a true value, which means it thinks it's succeeded but it doesn't actually reset the keychain.

senghuot-lay commented 1 year ago

For some reason, when I added readKeychain before resetting it works. Maybe someone here could explain to me why?

export async function resetKeychain() {
  await readKeychain();
  await resetGenericPassword();
}
jon-eubank commented 9 months ago

In my app (RN 0.71.12) when using react-native-keychain v8.1.1, if I call the resetGenericPassword() method after having saved my username and password previously, and then call getGenericPassword() afterwards it will return false. However if I then close the app, reopen it, and call getGenericPassword() then it will return garbage credentials, where the username is set to null and the password is some random string of letters, numbers, and dashes.