bernatfortet
bernatfortet

Reputation: 2312

How to validate Email address using Firebase

I'm doing a two step sign up process. First email, then password.

I'd like to validate if the email is not in use or badly formatted first. If it's ok, then show the password form.

Right now I can't find a good way to verify if the email is used.

I'd expect something like this:

 firebaseAuth.validateEmailAddress(email)

Upvotes: 9

Views: 12237

Answers (1)

Eevee
Eevee

Reputation: 76

You can check if an email is in use by checking if fetchProvidersForEmail returns an empty array.

https://firebase.google.com/docs/reference/js/firebase.auth.Auth#fetchProvidersForEmail

Upvotes: 6

Related Questions