react-native-keychain icon indicating copy to clipboard operation
react-native-keychain copied to clipboard

iOS 14.4 getGenericPassword returns a string when there is no password in keychain

Open abumalick opened this issue 4 years ago • 2 comments

For some reason, getGenericPassword in iOS 14.4 is returning a big string when the user has no password in the keychain.

const { password } = await Keychain.getGenericPassword();
console.log(`PIN is ${password}`)

image

I don't know if it is related but the full process to reproduce it for us was to

  • reset the password: Keychain.resetGenericPassword()
  • reload the app
  • call Keychain.getGenericPassword()

I believe I can push a reproduction repository if you need to.

abumalick avatar Feb 16 '21 20:02 abumalick

It's possible that another library also store stuff in the keychain that you are getting. Try specifying a service instead.

oblador avatar Mar 03 '21 17:03 oblador

What @oblador said.

iAmHarmon avatar Aug 06 '21 01:08 iAmHarmon