Major changes around events, event log, etc.
* User event log is now functional & attached to various events * Add additional missing system events * Completely re-write last_callers to have new functionality, etc. * Events.addListenerMultipleEvents() * New 'moduleInitialize' export for module init vs Event specific registerEvents * Add docs on last_callers mod
This commit is contained in:
11
core/user.js
11
core/user.js
@@ -179,7 +179,7 @@ module.exports = class User {
|
||||
);
|
||||
}
|
||||
|
||||
create(password, cb) {
|
||||
create(createUserInfo , cb) {
|
||||
assert(0 === this.userId);
|
||||
const config = Config();
|
||||
|
||||
@@ -219,7 +219,7 @@ module.exports = class User {
|
||||
);
|
||||
},
|
||||
function genAuthCredentials(trans, callback) {
|
||||
User.generatePasswordDerivedKeyAndSalt(password, (err, info) => {
|
||||
User.generatePasswordDerivedKeyAndSalt(createUserInfo.password, (err, info) => {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -244,7 +244,12 @@ module.exports = class User {
|
||||
});
|
||||
},
|
||||
function sendEvent(trans, callback) {
|
||||
Events.emit(Events.getSystemEvents().NewUser, { user : self });
|
||||
Events.emit(
|
||||
Events.getSystemEvents().NewUser,
|
||||
{
|
||||
user : Object.assign({}, self, { sessionId : createUserInfo.sessionId } )
|
||||
}
|
||||
);
|
||||
return callback(null, trans);
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user