2021-01-28 18:18:31 +02:00
|
|
|
Meteor.publish('user-miniprofile', function(usernames) {
|
|
|
|
check(usernames, Array);
|
2015-12-08 16:18:44 -05:00
|
|
|
|
2021-01-28 18:18:31 +02:00
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
// console.log('usernames:', usernames);
|
|
|
|
return Users.find(
|
|
|
|
{ username: { $in: usernames } },
|
|
|
|
{ fields: Users.safeFields },
|
|
|
|
);
|
2015-12-08 16:18:44 -05:00
|
|
|
});
|
2017-02-24 22:10:38 +08:00
|
|
|
|
|
|
|
Meteor.publish('user-admin', function() {
|
|
|
|
return Meteor.users.find(this.userId, {
|
|
|
|
fields: {
|
|
|
|
isAdmin: 1,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
2018-10-03 11:50:52 +03:00
|
|
|
|
2018-10-09 14:14:39 +02:00
|
|
|
Meteor.publish('user-authenticationMethod', function(match) {
|
2018-10-03 11:50:52 +03:00
|
|
|
check(match, String);
|
2019-06-28 12:52:09 -05:00
|
|
|
return Users.find(
|
|
|
|
{ $or: [{ _id: match }, { email: match }, { username: match }] },
|
|
|
|
{
|
|
|
|
fields: {
|
|
|
|
authenticationMethod: 1,
|
|
|
|
},
|
2018-10-03 11:50:52 +03:00
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
);
|
2018-10-03 11:50:52 +03:00
|
|
|
});
|