nodebb-plugin-session-sharing 7.0.0 → 7.1.0
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/library.js +5 -5
- package/package.json +2 -2
package/library.js
CHANGED
|
@@ -420,13 +420,12 @@ plugin.addMiddleware = async function ({ req, res }) {
|
|
|
420
420
|
if (Object.keys(req.cookies).length && req.cookies.hasOwnProperty(plugin.settings.cookieName) && req.cookies[plugin.settings.cookieName].length) {
|
|
421
421
|
try {
|
|
422
422
|
const uid = await plugin.process(req.cookies[plugin.settings.cookieName]);
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
if (plugin.settings.behaviour === 'revalidate' || plugin.settings.behaviour === 'update') {
|
|
427
|
-
res.locals.reroll = false; // disable session rerolling in core
|
|
423
|
+
if (uid === req.uid) {
|
|
424
|
+
winston.verbose(`[session-sharing] Re-validated login for uid ${uid}, path ${req.originalUrl}`);
|
|
425
|
+
return;
|
|
428
426
|
}
|
|
429
427
|
|
|
428
|
+
winston.verbose('[session-sharing] Processing login for uid ' + uid + ', path ' + req.originalUrl);
|
|
430
429
|
await nbbAuthController.doLogin(req, uid);
|
|
431
430
|
|
|
432
431
|
req.session.loginLock = true;
|
|
@@ -467,6 +466,7 @@ plugin.addMiddleware = async function ({ req, res }) {
|
|
|
467
466
|
const isAdmin = await user.isAdministrator(req.user.uid);
|
|
468
467
|
|
|
469
468
|
if (plugin.settings.behaviour !== 'update' && (plugin.settings.adminRevalidate === 'on' || !isAdmin)) {
|
|
469
|
+
winston.verbose(`[session-sharing] Found login session but no cookie, logging out user (was uid ${req.uid})`);
|
|
470
470
|
await logoutAsync(req);
|
|
471
471
|
res.locals.fullRefresh = true;
|
|
472
472
|
return handleGuest(req, res);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-session-sharing",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Allows login sessions from your app to persist in NodeBB",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"readmeFilename": "README.md",
|
|
23
23
|
"nbbpm": {
|
|
24
|
-
"compatibility": "^
|
|
24
|
+
"compatibility": "^3.0.0"
|
|
25
25
|
},
|
|
26
26
|
"husky": {
|
|
27
27
|
"hooks": {
|