Change PIN
The React Native SDK exposes a changePin
function to allow the currently logged in user to change their PIN. The user is first requested to provide their current PIN, before being allowed to create the new PIN. The flow for this is communicated through pinEvents
, which have to be handled by the application. An example of this can be found in usePinFlow
in the example app.
The PIN entered by the user should not be stored on the device or elsewhere in any shape or form. The React Native SDK takes care of this for you in a secure manner.
Example code to change the PIN of the currently logged in user
const [ flow, pin, visible, isConfirmMode, error, provideNewPinKey, cancelPinFlow, pinLength, userInfo] = usePinFlow()
OneWelcomeSdk.changePin()
.then(() => console.log('Change pin succeed!'))
.catch(error => console.error('Change pin failed: ', error.message));
// ...