Learn how to verify the user mail using OTP and reset the password from the app

Hii! Flutter Developer, I am here with another interesting flutter blog. In this blog, we shall learn how to authenticate using firebase API, verify the user email with OTP learn how to reset the password.

Using firebase_auth the package you can also do the same. Using this package is you can use the resetPassword method to send the reset password link on the user’s mail and there you can reset the password. But I wanted to reset the password from the app itself. So I researched about it and I got the following solution.

While making this app I came across a bug, that the firebase backend accepts the anonymous email while authentication. In general, accepting anonymous emails is not a good practice. So it would be really great to verify the user’s email with an OTP and then reset the password.

Before getting into the coding part let me first explain to you what we are going to build in the app. Firstly we will make a SignUp Login screen that will handle the authentication. On the Login page, we will use Forgot Password bottom to reset the password. On tapping it will navigate us to forget password screen, it will have one reset password button. This button will trigger the verify method that will send an OTP to the given mail. After that will build a screen to get the OTP from the user and then we will verify it, if it is right then we will navigate to a new screen that will take the new password from the user and update it on the database using API.

UI Part

#reset #passwords #flutter

Verify Email and Reset Password in Flutter
16.35 GEEK