How to access oAuth tokens in the client if they were added with connect-with


#1

I am using Mondora’s connect-with package to allow users to store their credentials and make API calls to whatever service. I want these API calls to be done on the client, so for example if a user wants to do a Twitter search I will need access to their auth-token.

What happens is:

  1. User logs in, say with Google
  2. User authenticates with Twitter, and connect-with does the job of adding the new service to the user document. I can see the new service in the mongo shell if I run:
    meteor:PRIMARY> db.users.find()
  3. In the browser, as this user, I run:
    Meteor.user().services
    and the result is that only the Google service is listed.

So the Twitter service is added to Mongo, but I can’t access it on the client.

Any ideas? Thanks a million.


#2

For whatever reason I can make things work by removing autopublish and manually creating the publish/subscription which I needed to do eventually anyway. I guess I don’t quite understand how autopublish works, maybe it needs to be invoked or refreshed in certain conditions.