[Picker API] How to get userId (manually from Meteor request)?


#1

I am using arunoda’s Picker to provide some JSON data from the backend to my Meteor application. Now I would like to use Meteor`s user system for authorization. Picker itself does not support this.

  Picker.route('/api/ping', function(params, req, res, next) {
    console.log('Picker.route /api/ping');
    res.end(JSON.stringify({'ping':'pong'}, null, 4));
  });

Is it possible to manually find the logged in user? How can I get the user cookie from the request and how do I lookup the user in the Meteor system myself?