Browse Source

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

Sam X. Chen 5 years ago
parent
commit
a37723f8a4
1 changed files with 1 additions and 0 deletions
  1. 1 0
      models/users.js

+ 1 - 0
models/users.js

@@ -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');