@optimiser/common 1.0.255 → 1.0.256
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/utility.js +4 -2
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -2614,13 +2614,15 @@ paratemter : {
|
|
|
2614
2614
|
*/
|
|
2615
2615
|
function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
2616
2616
|
if (dbMaster) {
|
|
2617
|
+
var sessionID_1 = '';
|
|
2617
2618
|
var updateQuery_1 = { "IsActive": false, "Description": options.Description, "ModifiedBy": options.RemovedBy, "ModifiedDate": new Date() };
|
|
2618
|
-
dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id":
|
|
2619
|
+
dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id": 1, "SessionKey": 1, "Platform": 1 } }).toArray(function (err, data) {
|
|
2619
2620
|
if (err) {
|
|
2620
2621
|
if (options.callback)
|
|
2621
2622
|
options.callback({ message: 'error', error: err });
|
|
2622
2623
|
}
|
|
2623
2624
|
if (data) {
|
|
2625
|
+
sessionID_1 = data.map(function (x) { return x._id; });
|
|
2624
2626
|
if (options.Platform) {
|
|
2625
2627
|
data = data.filter(function (x) { return (x.Platform == options.Platform); });
|
|
2626
2628
|
}
|
|
@@ -2633,7 +2635,7 @@ function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
|
2633
2635
|
}
|
|
2634
2636
|
}
|
|
2635
2637
|
}
|
|
2636
|
-
dbMaster.collection('Session').updateMany({ "UserID": options.UserID, "IsActive": true }, { $set: updateQuery_1 }, function (err, data) {
|
|
2638
|
+
dbMaster.collection('Session').updateMany({ _id: sessionID_1, "UserID": options.UserID, "IsActive": true }, { $set: updateQuery_1 }, function (err, data) {
|
|
2637
2639
|
if (err) {
|
|
2638
2640
|
if (options.callback)
|
|
2639
2641
|
options.callback({ message: 'error', error: err });
|