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

see: https://owasp.org/www-community/attacks/Session_fixation
This commit is contained in:
Julian Lam
2021-04-13 21:32:16 -04:00
parent e845c34b52
commit 697ed3bf37

View File

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