How to only store data for current logged in user using Firestore

前端 未结 2 1968
情话喂你
情话喂你 2021-01-03 09:06

Below is the code which allows the user to store data into Firestore. The problem is, the uploaded data is viewable for all the users logged into the app. How would I be ab

2条回答
  •  借酒劲吻你
    2021-01-03 09:39

    You would need to add a firestore rule to prevent a user from adding data to another user. Just check the auth userid in firestore and compare it to the userid on the document.

提交回复
热议问题