Linking credentials so phone or email login logs the user into the same account.

Actions & Logic

I have an app where the user can use either their email or their phone number to log in. So, during onboarding, the user account is created on the first screen with email, and on the second screen with phone. However, firebase creates two separate auth UIDs for each user: one for their email and one for their phone #. Both email and phone_number are correctly stored in their one user account, so far so good.

The problem is, depending on what login method they use later, the app seems to point to entirely different user profiles. But there is only one user! It seems as if FF is passing the specific authorization UID along after being logged in, instead of the Authenticated User Reference.

How do I merge / link two credentialing methods? For reference, the two screenshots are from the same user, using the same onboarding process, but one is using phone auth and one email auth. Do I need a custom function?

What have you tried so far?

right now there are two auth processes, both linked to the same user document.

Did you check FlutterFlow's Documentation for this topic?
Yes
7
2 replies