Skip to content

Node.js based forum software built for the modern web

fix: removing duplicate session rerolling code (as it is in passport@^0.6 now)

Julian Lam65b3996ac60e
diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js
index 10b93e2bf5..2a006b321c 100644
--- a/src/controllers/authentication.js
+++ b/src/controllers/authentication.js
@@ -339,19 +339,7 @@ authenticationController.doLogin = async function (req, uid) {
return;
}
const loginAsync = util.promisify(req.login).bind(req);
-
- const { reroll } = req.res.locals;
- if (reroll !== false) {
- const regenerateSession = util.promisify(req.session.regenerate).bind(req.session);
-
- const sessionData = { ...req.session };
- await regenerateSession();
- for (const [prop, value] of Object.entries(sessionData)) {
- req.session[prop] = value;
- }
- }
-
- await loginAsync({ uid: uid }, { keepSessionInfo: true });
+ await loginAsync({ uid: uid }, { keepSessionInfo: req.res.locals !== false });
await authenticationController.onSuccessfulLogin(req, uid);
};