Reputation: 43
I was wondering if getAuth().uid
is sensitive/private in anyway? I am planning to use it on a user post something like: post.created_by: getAuth().uid
. This makes writing rules/logic a lot easier.
The other way is to use the push id when the user is added to the database, which I'm trying to avoid.
Upvotes: 4
Views: 1167
Reputation: 3527
No its safe to use the uid
and recommended, firebase uses auth to authenticate the user and the assign the uid
to identify the user across firebase.
You will be using uid in your security rules and as well as to identify user info in your db records. Manually creating another id will render the efficiency of firebase useless.
Upvotes: 6