Posting Firebases's thirdpartyuserdata object to the server

*爱你&永不变心* 提交于 2019-12-24 17:34:38

问题


I'm using Firebase and the SimpleLogin to allow users to login via Google, Twitter etc.

I'd like to use some of the thirdpartyuserdata object to create a user profile for my application which runs on Node.

Currently I'm posting this data to the server so that I can add to it and create the profile object, but I wondered if there's a better way of doing this - is there something I can call server side to get this thirdpartyuserdata without having to post it from the client?


回答1:


Start by considering that your "server" is actually just another consumer of Firebase data. Since FirebaseSimpleLogin is simply a token generator with some fancy tools for doing OAuth, and because this happens completely client-side, there is nothing to consume about this.

If you want to consume the data at the server, you will either need to POST it, as you have done, or use Firebase to transfer the information. You'll find that a queue approach can save you a large amount of code, as this allows you to use Firebase as the API, and avoid creating RESTful services in Node, and all the baggage that comes with that.

The idea of a queue is simply that you push data into Firebase at one client and read it out (and probably delete it) at the intended recipient (in this case your node worker).



来源:https://stackoverflow.com/questions/24740884/posting-firebasess-thirdpartyuserdata-object-to-the-server

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