Two accounts made with the same email error - Firebase Auth

I have my firebase authentication set to prevent multiple accounts for the same email, but it doesn't seem to be the case. See the following figures:

firebase console

firebase accounts

Has anyone encountered this problem before?

** Edit: Here's how to reproduce this error:

Much of the problem comes down to function updateEmail()

.

When a user subscribes to my application, I want to have an email for the user, so finding that user is easier. The problem is that Facebook authentication does not guarantee that the user has an email for two reasons:

  • User may not allow email permissions.
  • The user could only create their Facebook account using their phone number.

Because of this, my login code is a bit tricky, but here's a link to my code with comments to explain everything (note that I'm using Facebook / Google custom buttons, so I had to manually do some things): Login

If you look at func getFBUserData()

and see the comments above, the error will occur at the first paragraph of the Case 1 marker:

// 1) user facebook does have email. This is common case
//         - in this case, sign them into Firebase
//               - could be that they previously didn't have email but now they do, so update Firebase user email

      

This is an edge case where for some reason the user did not initially allow the email permissions and then changed their mind and allowed them. Interestingly, the code will still throw the .errorCodeEmailAlreadyInUse error, but the account will appear in the Firebase console as shown in the picture in the SO question, and the following is what I just did: http://imgur.com/yMjYXgH

+3


source to share





All Articles