firebase / snippets-web

Web snippets for firebase.google.com
Apache License 2.0
737 stars 241 forks source link

One account should be deleted before linking two existing ones #362

Open Alynva opened 8 months ago

Alynva commented 8 months ago

I'm trying to replicate the example of merging two existing accounts, but I think that the problem is that the docs doesn't explicit says that the prevUser needs to be deleted from Firebase Auth, and not only its data from my "repo", it just says that I need to delete the users's data:

https://github.com/firebase/snippets-web/blob/88aa8eb8210c90263eef7fe1f454cd6477a5a252/snippets/auth-next/link-multiple-accounts/auth_merge_accounts.js#L21-L22

And it says that it would be restored if necessary, but it doesn't restore the actual user that should be deleted beforehand. But to restore it we would need the prevUser credential, that wouldn't be valid anymore?! Idk...