@optimiser/common 1.0.256 → 1.0.257
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 +11 -3
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -2614,7 +2614,8 @@ paratemter : {
|
|
|
2614
2614
|
*/
|
|
2615
2615
|
function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
2616
2616
|
if (dbMaster) {
|
|
2617
|
-
|
|
2617
|
+
//commented by Nidhi on 24-Feb-2022, removing session id for seaching sessions
|
|
2618
|
+
// let sessionID: any = '';
|
|
2618
2619
|
var updateQuery_1 = { "IsActive": false, "Description": options.Description, "ModifiedBy": options.RemovedBy, "ModifiedDate": new Date() };
|
|
2619
2620
|
dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id": 1, "SessionKey": 1, "Platform": 1 } }).toArray(function (err, data) {
|
|
2620
2621
|
if (err) {
|
|
@@ -2622,7 +2623,7 @@ function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
|
2622
2623
|
options.callback({ message: 'error', error: err });
|
|
2623
2624
|
}
|
|
2624
2625
|
if (data) {
|
|
2625
|
-
|
|
2626
|
+
// sessionID = data.map(x => x._id);
|
|
2626
2627
|
if (options.Platform) {
|
|
2627
2628
|
data = data.filter(function (x) { return (x.Platform == options.Platform); });
|
|
2628
2629
|
}
|
|
@@ -2635,7 +2636,14 @@ function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
|
2635
2636
|
}
|
|
2636
2637
|
}
|
|
2637
2638
|
}
|
|
2638
|
-
|
|
2639
|
+
//added by Nidhi on 24-Feb-2022, searching user session by platform
|
|
2640
|
+
var searchQuery = { "UserID": options.UserID, "IsActive": true };
|
|
2641
|
+
if (options.Platform) {
|
|
2642
|
+
searchQuery["Platform"] = options.Platform;
|
|
2643
|
+
}
|
|
2644
|
+
//commented by Nidhi on 24-Feb-2022, removing session id for seaching sessions
|
|
2645
|
+
//dbMaster.collection('Session').updateMany({ _id: sessionID, "UserID": options.UserID, "IsActive": true }, { $set: updateQuery },
|
|
2646
|
+
dbMaster.collection('Session').updateMany(searchQuery, { $set: updateQuery_1 }, function (err, data) {
|
|
2639
2647
|
if (err) {
|
|
2640
2648
|
if (options.callback)
|
|
2641
2649
|
options.callback({ message: 'error', error: err });
|