How do I check if an email address is already registered on Firebase?


(Karthik Kamalakannan) #1

I’m trying to write a custom login module for my mobile app. How do I check if a user has already registered with my app?

If the user is already registered, I’ll have to take them to a whole new activity/screen if they’ve already registered.

Does this feature come out of the box with Firebase SDK?

(Dikson Samuel R) #2

Yes. It is possible. I’ve worked on this for a music app.

Here’s a code snippet that might help you:

      	.createUserWithEmailAndPassword(email, password)
      	.then(function(user) {
      		//this will sign up user with this email
      		// if users exsists it will throw error