소스 검색

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

Sam X. Chen 5 년 전
부모
커밋
a37723f8a4
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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');