mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: removing duplicate session rerolling code (as it is in passport@^0.6 now)
This commit is contained in:
@@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user