nodebb-plugin-session-sharing 8.0.2 → 8.0.4
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 +8 -1
- package/package.json +1 -1
package/library.js
CHANGED
|
@@ -455,7 +455,14 @@ plugin.addMiddleware = async function ({ req, res }) {
|
|
|
455
455
|
const uid = await plugin.process(req.cookies[plugin.settings.cookieName]);
|
|
456
456
|
if (uid === req.uid) {
|
|
457
457
|
winston.verbose(`[session-sharing] Re-validated login for uid ${uid}, path ${req.originalUrl}`);
|
|
458
|
-
|
|
458
|
+
const wasForceLogin = !!req.session.forceLogin;
|
|
459
|
+
delete req.session.forceLogin;
|
|
460
|
+
await nbbAuthController.onSuccessfulLogin(req, uid, true, wasForceLogin);
|
|
461
|
+
if (wasForceLogin && req.session.returnTo) {
|
|
462
|
+
const url = req.session.returnTo;
|
|
463
|
+
delete req.session.returnTo;
|
|
464
|
+
res.redirect(nconf.get('relative_path') + url);
|
|
465
|
+
}
|
|
459
466
|
return;
|
|
460
467
|
}
|
|
461
468
|
|