react-native-expo-auth
React Native Expo Component that provides Sign In, Sign Up, Reset Password flows for user authentication. The component includes an API for FaceID and TouchID (iOS) and Fingerprint API (Android) to authenticate the user with a face or fingerprint scan.
Installation
$ npm install --save react-native-expo-auth
or
$ yarn add react-native-expo-auth
Usage
// ... ;; const ExampleApp = { const isVisible setIsVisible = ; const logins setLogins = ; /** * Each callback should return object that contains success and/or error. * @param * @returns {{ success: Boolean, error: String }} */ const submitAuth = asyncdata route const signUpRaw = await ; ifsignUpRawstatus !== 200 return success: false error: await signUpRawtext ; const emails = await signUpRaw; ; return success: true ; ; const submitSignIn = async await ; const submitSignUp = async await ; const submitBioLogin = async await ; const submitPinCodeRequest = async await ; const submitNewPassword = async await ; { return <Authenticate visible=isVisible onLogin=submitSignIn onSignUp=submitSignUp onBioLogin=submitBioLogin logins=logins onPinCodeRequest=submitPinCodeRequest onSubmitNewPassword=submitNewPassword enableBio=true > <Text>YOUR LOGO</Text> <Image source= /> </Authenticate> ; } }; // ...
Props
Prop | Type | Description |
---|---|---|
visible | boolean | Set to true to show the component. By default visible is set to true. |
onLogin | function | Callback will be called once user submits login form. |
onSignUp | function | Callback will be called once user submits submit form. |
onBioLogin | function | Callback will be called once user uses Mobile Biometric Check( faceId, fingerprint or Pin Code). |
logins | array | An array of logins which a user is allowed to use during bioLogin. Logins get populated when a user signs in/up using a specific device. |
onPinCodeRequest | function | Callback that will be called if a user submits forgot password form. |
onSubmitNewPassword | function | Callback will be called once a user submits a new password after resetting the old one. |
enableBio | boolean | Enables/Disables Mobile Biometric Check. |
Contribute
Feel free to open issues or do a PR!