|
|
@ -339,19 +339,7 @@ authenticationController.doLogin = async function (req, uid) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const loginAsync = util.promisify(req.login).bind(req);
|
|
|
|
const loginAsync = util.promisify(req.login).bind(req);
|
|
|
|
|
|
|
|
await loginAsync({ uid: uid }, { keepSessionInfo: req.res.locals !== false });
|
|
|
|
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 authenticationController.onSuccessfulLogin(req, uid);
|
|
|
|
await authenticationController.onSuccessfulLogin(req, uid);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|