Open rick427 opened 1 year ago
When you init the PinCode component, you have to get the pin from where you stored and pass the pin to the component
<PinCode pin={stored_pin_here} />
The onEnter is only triggered if the correct pin has been entered. You don't check the entered pin every time.
This is not an authentication/signin component. It's just an interface to temporarily block the content for data sensitive apps. It's convenient so that you don't have to write screens with bunch of buttons and checking pin by yourself.
Sorry if the docs is confusing! I assume that people who look for such pincode component get the idea that it's not client-server authentication.
@anhnch you have not added the pin prop in the types for the PinCode please add it !!
I don't quite understand how this component works even after reading the docs countless times ? Each time I enter a pin I always get an error text message ("wrong pin") and the input gets reset. I would like to send the pin the user enters whether right or wrong to my server to verify, but the onEnter method doesn't trigger unless "it's the right pin" ??? so how do I go about this ?
just use the pin prop it will work he has added the pops in types for the PinCode
@anhnch is there a way to override the pin checking to use our own logic? i have the same requirement as OP, to use API to validate the pin as we don't want to store the pin in local storage.
I don't quite understand how this component works even after reading the docs countless times ? Each time I enter a pin I always get an error text message ("wrong pin") and the input gets reset. I would like to send the pin the user enters whether right or wrong to my server to verify, but the onEnter method doesn't trigger unless "it's the right pin" ??? so how do I go about this ?