From 65b3996ac60ed632045542ef0e7afe97f9b53d24 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 19 Aug 2022 12:52:24 -0400 Subject: [PATCH] fix: removing duplicate session rerolling code (as it is in passport@^0.6 now) --- src/controllers/authentication.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) 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); };