Can I send value with request to Firestore rules

纵饮孤独 提交于 2019-11-28 11:44:20

问题


I have to send value with request to check it from Firestore rules , like (Recaptcha to avoid spam) or origin (protect my own firebase api) ! is there any way to do that ?


回答1:


There is no way to pass custom parameters into the Firestore rules. The most common workaround is to pass information as part of the path, although it's definitely kludgy at times.

The best approach for preventing spam is to require your users to log in, and then limit what they can do based on knowing who they are, and knowing what they've done in the past. For example, most apps limit the places users can write to based on their identity, and many apps have a sort-of leveling system where users gradually get more permission as they've been using (and not abusing) the app longer.



来源:https://stackoverflow.com/questions/54648880/can-i-send-value-with-request-to-firestore-rules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!