Can the Firebase user id change?

前端 未结 2 608
后悔当初
后悔当初 2020-12-11 03:24

Can the Firebase user id change? What I talk about is this, FirebaseAuth.getInstance().getCurrentUser().getUid() If user delete his account like it is described

相关标签:
2条回答
  • 2020-12-11 03:34

    As said by @user663031, the answer "no" is correct.

    To add on to @user663031's answer, I'm working on a project, but I have to switch between the live database and the test database. I created a user (in firebase authentication) in both test & live environment with the same email address & password, however the id's are different.

    In order to achieve proper tests in both environments, I had to change id stored in real time database so that it matches the "unchangeable id" in authentication.

    0 讨论(0)
  • 2020-12-11 03:37

    I was assuming the getUid() id was tight to the E-Mail right, or!?

    Not "tied" in the sense of "derived from". "Tied" in the sense of "associated with".

    Remember that the email can be changed. When that happens, of course the id is left as is.

    You can easily test this in the Firebase console by creating a new user, checking the ID, changing the email and checking that the ID does not change, then deleting the user and creating a new user with the same email and checking that a new ID has been assigned.

    0 讨论(0)
提交回复
热议问题