Fix login did not work.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2019-08-20 21:14:16 +03:00
parent f96c1eda70
commit b2deab544b

View file

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