jarden-digital/react-native-pincode

What if the user forgot pincode?

Opened this issue · 5 comments

I wonder what if the user has forgotten the pin code. The app is locked forever. I've searched all of the available parameters, I've your code and there was nothing much I can do. Finally, my walkaround was to use the QUIT button on the locked screen to remove the pin code. I changed the text of the Quit button to "Forget pin code?". And I set the callback function to display a confirm dialog to clean up all the local storage data. One may argue that it's not good to clean up data. It's not a right or wrong situation. It's just what you want. I choose losing data than locking the users forever and the app turns to be useless. They gonna remove the app.

I hope you would look into the issue and standardize the process.

@anhnch
You can use deleteUserPinCode

import { deleteUserPinCode } from '@haskkor/react-native-pincode';

const resetPinCode = async () => {
  await deleteUserPinCode();
}

<Text onPress={resetPinCode}>reset pincode</Text>

Also you can open enter pin code page again when the user forgot pin code. The user can enter new password.
use status="enter" props with PINCode component.

@cagataykapuagasi i mean the pincode component is meant to prevent unauthorized access right? When the user opens up the app, the enter screen blocks and asks him to enter the code to access. There's nothing else the user can do if he forgot the code. So, at the "enter" screen, there should be a link/button at the bottom to navigate to the forgot screen. Once the fogot flow is finished. You allow accessing the app features.

Hey!
In our apps we handle this outside of the component.
If that's something you need could you please open a PR? We will not likely have time to work on this soon.

I've seen this pattern with other apps:

  1. attempt pin 3 times incorrectly, delete pin automatically
  2. log user out automatically
  3. when user logs back in, ask them to set pin again

Makes sense to me b/c it still requires user to log in w/ password, to set the pin.

Thoughts?

I created another one based on this package to reset the pin. You can log out/delete personal data when the event occurs.