0
votes

I am using two authentication methods with firebase , phone authentication and email link verification authentication. However both lead to separate accounts, I somehow want to connect email to account verified using phone , so that next time when email link authentication is used correct account ( linked via phone ) is retrieved.

I could find https://firebase.google.com/docs/auth/android/account-linking but this doesn't mention about link verification method.

What I am thinking here is , when user logs in using phone , can I add email to the users profile on firebase auth, so that same email can be used for email verification.

Any help in this regards will be highly appreciated.

1

1 Answers

1
votes

got the solution what i did was as follows . I first now authenticated user using phone , when OTP is verified instead of calling signInWith method I asked user if he wants to link an email with this phone. If user opts in and enters email , a verification link goes to his email account when user performs email verification , after returning to app I am linking this verified email with the phone authenticated account using the link. I already have the dynamic links working , so used it here as it is.