mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-23 19:20:41 +02:00
+ Add unique session ID to client sessions
* Aliased to user for convienence * Added to logs for easy tracing * Can be used from events/etc. for grouping
This commit is contained in:
parent
fbe87640c5
commit
1cb811576b
2 changed files with 15 additions and 3 deletions
|
@ -55,11 +55,19 @@ function userLogin(client, username, password, cb) {
|
|||
return cb(existingConnError);
|
||||
}
|
||||
|
||||
|
||||
// update client logger with addition of username
|
||||
client.log = logger.log.child( { clientId : client.log.fields.clientId, username : user.username });
|
||||
client.log = logger.log.child(
|
||||
{
|
||||
clientId : client.log.fields.clientId,
|
||||
sessionId : client.log.fields.sessionId,
|
||||
username : user.username,
|
||||
}
|
||||
);
|
||||
client.log.info('Successful login');
|
||||
|
||||
// User's unique session identifier is the same as the connection itself
|
||||
user.sessionId = client.session.uniqueId; // convienence
|
||||
|
||||
Events.emit(Events.getSystemEvents().UserLogin, { user } );
|
||||
|
||||
async.parallel(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue