Node.js based forum software built for the modern web
test: one more psql test fix, save session after setting forceLogin=1
Barış Soner Uşaklı661a467a1163
diff --git a/src/controllers/authentication.js b/src/controllers/authentication.jsindex c256b8681d..b39a4c6c4e 100644--- a/src/controllers/authentication.js+++ b/src/controllers/authentication.js@@ -327,7 +327,9 @@ function continueLogin(strategy, req, res, next) {function redirectAfterLogin(req, res, destination) {if (req.body?.noscript === 'true') {- res.redirect(`${destination}?loggedin`);+ req.session.save(() => {+ res.redirect(`${destination}?loggedin`);+ });} else {res.status(200).send({next: destination,diff --git a/src/middleware/index.js b/src/middleware/index.jsindex c6ea486393..2bb665d66c 100644--- a/src/middleware/index.js+++ b/src/middleware/index.js@@ -319,7 +319,9 @@ middleware.requirePageReAuth = function ({ reauthWindowMinutes = 2 } = {}) {} else {req.session.returnTo = req.url;const isAdminPath = req.path === '/admin' || req.path.startsWith('/admin/');- res.redirect(`${relative_path}/login${isAdminPath ? '?local=1' : ''}`);+ req.session.save(() => {+ res.redirect(`${relative_path}/login${isAdminPath ? '?local=1' : ''}`);+ });}}return helpers.try(async (req, res, next) => {