Skip to content

Node.js based forum software built for the modern web

fix: add wasForceLogin check to sso logins as well

Barış Soner Uşaklıc666586ef891
diff --git a/src/routes/authentication.js b/src/routes/authentication.js
index 2d323ec43d..cafb365ce8 100644
--- a/src/routes/authentication.js
+++ b/src/routes/authentication.js
@@ -147,9 +147,11 @@ Auth.reloadRoutes = async function (params) {
next();
})(req, res, next);
}, Auth.middleware.validateAuth, (req, res, next) => {
+ const wasForceLogin = !!req.session.forceLogin;
+ delete req.session.forceLogin;
async.waterfall([
async.apply(req.login.bind(req), res.locals.user, { keepSessionInfo: true }),
- async.apply(controllers.authentication.onSuccessfulLogin, req, res.locals.user.uid),
+ async.apply(controllers.authentication.onSuccessfulLogin, req, res.locals.user.uid, true, wasForceLogin),
], (err) => {
if (err) {
return next(err);