Skip to content

Commit

Permalink
fix: removing duplicate session rerolling code (as it is in passport@…
Browse files Browse the repository at this point in the history
…^0.6 now)
  • Loading branch information
julianlam committed Aug 19, 2022
1 parent 20ebf0a commit 65b3996
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/controllers/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit 65b3996

Please sign in to comment.