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); };