isite 2024.12.3 → 2024.12.5
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/lib/routing.js +2 -0
- package/lib/security.js +2 -1
- package/lib/session.js +18 -0
- package/lib/wsClient.js +1 -1
- package/package.json +1 -1
package/lib/routing.js
CHANGED
|
@@ -1422,6 +1422,8 @@ module.exports = function init(____0) {
|
|
|
1422
1422
|
_0xrrxo.start = function (_ports, callback) {
|
|
1423
1423
|
____0.startTime = Date.now();
|
|
1424
1424
|
|
|
1425
|
+
____0.ws.wsSupport();
|
|
1426
|
+
|
|
1425
1427
|
____0.https.globalAgent.options = {
|
|
1426
1428
|
key: ____0.fs.readFileSync(____0.options.https.key || __dirname + '/../ssl/key.pem'),
|
|
1427
1429
|
cert: ____0.fs.readFileSync(____0.options.https.cert || __dirname + '/../ssl/cert.pem'),
|
package/lib/security.js
CHANGED
|
@@ -393,7 +393,8 @@ module.exports = function init(____0) {
|
|
|
393
393
|
callback = callback || function () {};
|
|
394
394
|
let index = security.users.findIndex(
|
|
395
395
|
(user) =>
|
|
396
|
-
(_user.id && user.id
|
|
396
|
+
(_user.id && user.id == _user.id) ||
|
|
397
|
+
(_user._id && user._id == _user._id) ||
|
|
397
398
|
(!user.key && _user.email && user.email === _user.email.trim().toLowerCase()) ||
|
|
398
399
|
(!user.key && _user.username && user.username === _user.username.trim().toLowerCase()) ||
|
|
399
400
|
(!user.key && _user.mobile && user.mobile === _user.mobile.trim().toLowerCase()) ||
|
package/lib/session.js
CHANGED
|
@@ -124,6 +124,7 @@ module.exports = function init(req, res, ____0, callback) {
|
|
|
124
124
|
AssignFeatures();
|
|
125
125
|
|
|
126
126
|
// must get user every request ...
|
|
127
|
+
|
|
127
128
|
if (session.user_id) {
|
|
128
129
|
____0.security.getUser(
|
|
129
130
|
{
|
|
@@ -140,6 +141,23 @@ module.exports = function init(req, res, ____0, callback) {
|
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
);
|
|
144
|
+
} else if (session.user) {
|
|
145
|
+
____0.security.getUser(
|
|
146
|
+
{
|
|
147
|
+
email: session.user.email,
|
|
148
|
+
},
|
|
149
|
+
function (err, user) {
|
|
150
|
+
if (!err && user) {
|
|
151
|
+
if (user) {
|
|
152
|
+
req.features.push('login');
|
|
153
|
+
}
|
|
154
|
+
session.user_id = user.id;
|
|
155
|
+
session.user = user;
|
|
156
|
+
callback(session);
|
|
157
|
+
session.$save();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
);
|
|
143
161
|
} else {
|
|
144
162
|
callback(session);
|
|
145
163
|
session.$save();
|
package/lib/wsClient.js
CHANGED