I’d like to do the same - my setup is very simple: Each authenticated user (facebook) has only access to their own channel.
I have a sync_gateway & couchbase db (both latest community versions) running on an EC2 instance. I’ve created a sync_gateway config file which I’m pretty sure is wrong as I can push but not pull.
I have disabled GUEST access so only authenticated users can push & pull (using facebook auth)
I’m struggling to find out how to get hold of the facebook userid or username (anything user-unique) so that I can do something like:
var userChannel = “user-” + userId/Name
Firstly, am I approaching this the right way? I’m new to couchbase.
Provided I’m correct, how do I get the authenticated user id in the sync function? Or do I have to explicitly set the channel on the client (iOS/Android/whatever) before I push the document to the server?