I am working on a project with firebase and I want to detach the email from a user that is authenticated with phone + email/password. I am trying to use the unlink method for purpose.
However, as I was to find out, this method is not intended to detach the email from the user, but only to remove the password. That would be quite a problem, because not only will the removed email still show in the user's A account, but also any other user B will not be able to use the same email in the future (this would be rare, but it's a problem).
One solution I found interesting is to updateEmail and set it to undefined or update profile and do the same thing. Problem is firebase complains about that.
Therefore I am wondering what is the best practice to detach an email address from a user that is also logged in with a phone number? Is this best done by a cloud func?