Add Email/Phone Verification
Available from version > react-native-cotter@0.3.6
Most of the time, it's required for you to check if the user's identifier (their email or phone number) is valid. With Cotter, you can verify your users via email, SMS, or WhatsApp.
Step 1: Set Up Deep Linking
The verification will follow OAuth's PKCE flow which will open an in-app browser where your user can enter the OTP sent to their email/phone.
Pick a unique URL scheme for redirecting the user back to your app after the verification in the in-app browser is successful. For this example, we'll use myexample://auth_callback
.
Follow the guide under Sign in with Email/Phone – Step 3: Setting up Deep Linking, then come back to this step.
Step 2: Update your Sign Up Function
Make sure you followed the guide for Sign In with Device. Update your Sign Up Function that you made on Step 3.
Verifying Before Registering the User
Verify the email/phone number first, then continue registering the user if verification is successful
This will work the following way:
The user will be asked to verify their email or phone number
If verification successful, we'll create a new User
Then, set up the current device as trusted.
If the user already exists but doesn't have a Trusted Device set up (for example from logging-in to your website):
The user will be asked to verify their email or phone number
Then if verification successful, set up the current device as trusted.
Last updated