Adding this package to your Meteor application:
- makes
Meteor.userId()
work also inside the publish endpoint functions (even for Meteor versions prior to 1.5.1) - prevents direct modification of the user's profile from the client, which is otherwise allowed by Meteor
- extends
Meteor.user(userId)
intoMeteor.user(userId, fields)
which now accepts an argument to limit queried fields (and thus function's reactivity);userId
is optional and if not specifiedMeteor.userId()
is used instead
Both client and server side.
meteor add peerlibrary:user-extra
Template.user.helpers({
username: function () {
var user = Meteor.user({username: 1});
return user && user.username;
}
});