Home > Net >  Can I replace signed-in user using an older user uid in FireStore Anonymous Login?
Can I replace signed-in user using an older user uid in FireStore Anonymous Login?

Time:10-13

In my app, users are signed in anonymously. If someone uninstalls the app and re-installs it, the new generated uid is different from the older one. Is there some way I can revert the firebase auth instance to use the older uid instead of the new one?

CodePudding user response:

Once a user is signed out from Firebase's anonymous authentication provider, there is no way to reclaim that UID through that provider. Given that a user doesn't have to provide any credentials to sign-in anonymously, allowing them to claim a specific UID would be a big security risk.

The only option would be to build your own provider for Firebase Authentication and give the user the same UID as before there, after you've verified that they are the same user.

  • Related