scttnlsn / backbone.io

Backbone.js sync via Socket.IO

Home Page:http://scttnlsn.github.io/backbone.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backbone.io and facebook game

giorrrgio opened this issue · comments

Hi,
I'm trying to use backbone.io for a social game on facebook, where users can interact with each other and have eventually realtime visual feedback.
I managed to create mongoose models and used your middleware for storage, my problem is putting some pieces together: do you have hints on how can I use a stack of middlewares in order to store in session the facebook token, associate new users with their own session-stored facebook ids I get after facebook oauth connection, and keep them away from data they cannot see?
Just a general hint would be very appreciated, thanks!

You'll likely be building an HTTP request handler for the OAuth callback where you can grab the Facebook token. Store that in the session along with any other user data and access it from the Backbone.IO middleware. See examples/auth.js for a small example using sessions.