Fixing method in users.js didn't have check userId

This commit is contained in:
Sam X. Chen 2019-09-21 15:32:21 -04:00
parent e3a727edec
commit a37723f8a4

View file

@ -541,6 +541,7 @@ Users.mutations({
Meteor.methods({
setUsername(username, userId) {
check(username, String);
check(userId, String);
const nUsersWithUsername = Users.find({ username }).count();
if (nUsersWithUsername > 0) {
throw new Meteor.Error('username-already-taken');