Greeting, Dear community members, In our 34th lecture we learn how to use FirebaseAuth to sign in as a user with an email and password. Sometimes we need a security checkup that if the email is owned by the user or not. We will use Email Verification for this. Firebase will send a verification email to the user's email. If the user clicks on the link then the email gets verified and we can use whether the method is email verified or not. So let's get started.
Use this GitHub project to clone into your directory. The following lecture will constantly update it so you will never miss the latest code. Happy Coding!
What Should I Learn
- Send firebase email verification link
- Check if the email is verified or not
- Check if the email is verified or not before the first sign-in.
We will add email verification to the sign-in activity. After the successful login, our system will check if the email is verified or not. If the email is not verified then our system will send a verification link to the user.
But if the email is already verified then our system will open the Welcome Activity. First, we check if the email is verified or not.
Now move the code in the email verified part. Because in the last lecture we write the code to send the user to the next screen.
In the else, we will alert the user that the account is not verified and show a button a send the verification link. On VERIFY button click system will send the Verification link to the user email. We will show the Toast message for a Long duration.
Now, let's run the and check if we are getting the verification link or not.
I got the Verification link in the Spam folder. We can make it not spam by some setting in the firebase. We will do it in the future.