I'm currently building react native app which requires authentication using firebase. When the user sign up, I need to send 6 digit verification to email and when the user types that number in the app, then they can sign up. Same flow for the forgot password.(Send 6 digit to email -> user types 6 digit in the app -> set new password within the app)
From firebase api, there are sendEmailVerification() and sendPasswordResetEmail. For email verification, it changes user state emailVerified to true when clicked on link but I want to send 6 digit code (random each email) and when the user enters that code in the app, change the state to true then. For password reset, it makes the user to change the password within the email, but similar to email verification, I want to send 6 digit code and when the user types that code in the app, I want to make them change password within the app.
Is there a way to do this using firebase? If yes, could you provide code snippet for the example?