feat: roll session identifier on login, as security best practice

see: https://owasp.org/www-community/attacks/Session_fixation
v1.18.x
Julian Lam 4 years ago
parent e845c34b52
commit 697ed3bf37

@ -326,6 +326,9 @@ authenticationController.doLogin = async function (req, uid) {
return;
}
const loginAsync = util.promisify(req.login).bind(req);
const regenerateSession = util.promisify(req.session.regenerate).bind(req.session);
await regenerateSession();
await loginAsync({ uid: uid });
await authenticationController.onSuccessfulLogin(req, uid);
};

Loading…
Cancel
Save