This is a unique firebase user ID for the provider (facebook, twitter, password)

If you allow multiple auth providers in firebase (twitter, facebook, password), it is best to store users this way:

/users/[auth.id] _ [auth.provider] / ...

It looks like there might be an overlap in auth.id based on the provider.

In most examples, the security file is checked only by auth.id. I am trying to avoid the difficulty of creating my own user IDs.

Thoughts?

+4
source share
1 answer

Yes, if you use several auth providers with Simple Login, it is recommended to prefix or suffix them with the provider, just like yours. auth.id guaranteed to be unique to only the same provider.

Firebase now provides a uid parameter for an auth object that is guaranteed to be unique to all providers. For example, see "After Authentication" on any of the simple login providers, for example email / password

+9
source

Source: https://habr.com/ru/post/1491732/


All Articles