Fixes and updates.

This commit is contained in:
Wynne Crisman
2020-01-16 09:31:12 -08:00
parent 2e57558ef4
commit a20e42e360
25 changed files with 346 additions and 820 deletions

View File

@@ -12,7 +12,7 @@ if(Meteor.isServer) {
"insertUser": function(user) {
check(user, {
username: String,
email: String,
emails: [{address: String, verified: Match.Maybe(Boolean)}],
roles: [String]
});
@@ -21,7 +21,8 @@ if(Meteor.isServer) {
//Verify the user name isn't already used.
if(Meteor.collections.Users.findOne({username: user.username}) === undefined) {
let pwd = Random.secret(20);
let id = Accounts.createUser({password: pwd, username: user.username, email: user.email});
console.log("Email: " + user.emails[0]);
let id = Accounts.createUser({password: pwd, username: user.username, email: user.emails[0].address});
//Requires the alanning:roles package.
Roles.addUsersToRoles(id, user.roles);