2016-08-08 11:18:21 +09:00
|
|
|
import Telescope from 'meteor/nova:lib';
|
2016-11-15 15:59:34 +09:00
|
|
|
import Users from '../collection.js';
|
2016-08-08 11:18:21 +09:00
|
|
|
|
2016-11-15 15:59:34 +09:00
|
|
|
function novaCreateUserCallbacks (options, user) {
|
2016-10-07 10:50:21 +02:00
|
|
|
user = Telescope.callbacks.run("users.new.sync", user, options);
|
2016-11-15 15:59:34 +09:00
|
|
|
|
|
|
|
Telescope.callbacks.runAsync("users.new.async", user);
|
|
|
|
|
|
|
|
// check if all required fields have been filled in. If so, run profile completion callbacks
|
|
|
|
if (Users.hasCompletedProfile(user)) {
|
|
|
|
Telescope.callbacks.runAsync("users.profileCompleted.async", user);
|
|
|
|
}
|
|
|
|
|
2015-05-06 12:28:00 +09:00
|
|
|
return user;
|
2016-11-15 09:02:30 +01:00
|
|
|
}
|
2016-04-03 11:27:53 +09:00
|
|
|
|
2016-11-15 15:59:34 +09:00
|
|
|
Accounts.onCreateUser(novaCreateUserCallbacks);
|