add ldap support | simplify authentications

This commit is contained in:
guillaume 2018-10-09 14:14:39 +02:00
parent 5b8c642d8f
commit 3b4f285fea
15 changed files with 493 additions and 49 deletions

View file

@ -321,3 +321,15 @@ Migrations.add('add-subtasks-allowed', () => {
},
}, noValidateMulti);
});
Migrations.add('add-authenticationMethod', () => {
Users.update({
'authenticationMethod': {
$exists: false,
},
}, {
$set: {
'authenticationMethod': 'password',
},
}, noValidateMulti);
});

View file

@ -17,6 +17,7 @@ Meteor.publish('people', function(limit) {
'emails': 1,
'createdAt': 1,
'loginDisabled': 1,
'authenticationMethod': 1
},
});
} else {

View file

@ -18,12 +18,11 @@ Meteor.publish('user-admin', function() {
});
});
Meteor.publish('user-connection-method', function(match) {
Meteor.publish('user-authenticationMethod', function(match) {
check(match, String);
return Users.find({$or: [{email: match}, {username: match}]}, {
return Users.find({$or: [{_id: match}, {email: match}, {username: match}]}, {
fields: {
ldap: 1,
'authenticationMethod': 1,
},
});
});