1

Is it Possible? can I send email verification before I create a user with email and password in Firebase authentication using flutter? I wanted to know this because if I register the entered mail and then if I send email verification, then if the email account is not valid(i.e the email format is correct, but it is not present in google database to send link to email), then it would simply create a record in Firebase authentication which is a loss of storage, so I would like to know. Thank you

Pavan Kumar V
  • 592
  • 6
  • 17

2 Answers2

2

There are two providers for signing in with email to Firebase:

  1. Through Email+password. There is no way to require the user to verify their email address before they can sign in with this provider. You can of course prevent users without a verified email address from using the app, and accessing the data.
  2. Through Email link. Here the user gets an email with a sign-in link, so their email address is implicitly verified as part of signing in.

If you want to require the user to verify their email address before they can sign in, it might be best to have them sign in through an email link.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
0

In addition to @Frank's answer, when a user signs up you can send verification email to them. You can always check if the user has verified their email in your app by checking the isEmailVerified property as well as in security rules.

Talking of database storage, you can run a scheduled cloud function every midnight to delete data of users who have not verified their email. You can refer to this answer for a detailed explanation on periodically deleting unverified users.

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
  • Thank you frank and Dharmaraj, your answers were very useful, the idea of cloud function i liked it very much , I'am gonna implement it. – Pavan Kumar V Jul 12 '21 at 07:10