Added option to send user metadata to the server session
This commit is contained in:
+7
-1
@@ -38,7 +38,7 @@ function login(pduObj) {
|
||||
|
||||
// If there is a checkuserpass(), use it to check system_id and password from the PDU
|
||||
if (typeof this.options.checkuserpass === 'function') {
|
||||
this.options.checkuserpass(pduObj.params.system_id, pduObj.params.password, function(err, res) {
|
||||
this.options.checkuserpass(pduObj.params.system_id, pduObj.params.password, function(err, res, userData) {
|
||||
if (err) {
|
||||
that.closeSocket();
|
||||
return;
|
||||
@@ -54,6 +54,12 @@ function login(pduObj) {
|
||||
|
||||
log.verbose('larvitsmpp: lib/server.js: serverSession() - login() - Login successful! Connected host: ' + that.sock.remoteAddress + ':' + that.sock.remotePort + ' system_id: "' + pduObj.params.system_id + '"');
|
||||
that.loggedIn = true;
|
||||
|
||||
// Set additional user data to the session
|
||||
if (userData !== undefined) {
|
||||
that.userData = userData;
|
||||
}
|
||||
|
||||
that.sock.resume();
|
||||
that.sendReturn(pduObj);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user