Last updated
Last updated
AuthFlow
?Exactly what it sounds like. The component that handles the screens and logic to authenticate your users with phone auth.
None 😇
Note that the following customizations are fully optional. You do not need to use them to make a great auth flow!
You also have the following props:
confirmScreenProps
phoneScreenProps
If you want to use one of those props, pass it directly to AuthFlow
as seen in the example code below.
onSmsSuccessfullySent
Function called when an SMS is sent successfully.
Receives a dictionary with a phoneNumber
field.
onCodeVerified
Callback function called when a user's 6-digit code is verified, and they are authenticated.
Receives a dictionary with a token
field.
onUserSuccessfullySignedIn
Function called when user is successfully signed in
This gets called after onCodeVerified
, since there is a network request made between the successful code and signing in with firebase.
Receives a dictionary with a user
field.
The user
could be null
, so check for that.
You probably won't need to use this, but it's there for your convenience.
See the . Make sure you have your app wrapped with DoormanProvider
and AuthGate
.
The AuthFlow
component is used instead of , if you prefer a component-based API.
First, any of the can be used to customize the style.
Any of the optional props from will be passed down to it, except onCodeVerified
. If you want to use that prop, pass it directly to AuthFlow
.
Any of the optional props from will be passed down to it, except onSmsSuccessfullySent
onUserSuccessfullySignedIn
.
If you want to control your own navigation for the transition between screens, you should make screens with the and , instead of using AuthFlow
.
We also have example code using .
AuthFlow is the component-based alternative to withPhoneAuth.