During the rendering of my responsive component, I get Meteor.user() null. Then I tried to access Meteor.userId()and got it correctly as a registered user id. Also tried to access the user using Meteor.users.findOne(), but failed.
My question is: why is the user object undefined, although the user id is available?
I used the following code snippet for testing:
var uid = Meteor.userId();
console.log(uid);
var usr = Meteor.user();
console.log(usr);
var usr1 = Meteor.users.findOne({_id: uid});
console.log(usr1);
source
share