浏览代码

Fix login did not work.

Thanks to xet7 !
Lauri Ojansivu 5 年之前
父节点
当前提交
b2deab544b
共有 1 个文件被更改,包括 0 次插入25 次删除
  1. 0 25
      models/users.js

+ 0 - 25
models/users.js

@@ -257,31 +257,6 @@ Users.attachSchema(
   }),
 );
 
-Users.before.update(function(userId, fieldNames) {
-  const user = Users.findOne({ _id: userId });
-  if ((user && user.isAdmin) || (Meteor.user() && Meteor.user().isAdmin)) {
-    return true;
-  }
-  if (!user) {
-    return false;
-  }
-  if (_.contains(fieldNames, 'services')) {
-    return false;
-  }
-  if (_.contains(fieldNames, 'heartBeat')) {
-    return false;
-  }
-  if (_.contains(fieldNames, 'isAdmin')) {
-    return false;
-  }
-  if (_.contains(fieldNames, 'loginDisabled')) {
-    return false;
-  }
-  if (_.contains(fieldNames, 'authenticationMethod')) {
-    return false;
-  }
-});
-
 Users.allow({
   update(userId, doc) {
     const user = Users.findOne({ _id: userId });