test: passport0.6 (#10638)

* test: passport0.6

* test: make logout async, fix lint

* test: keepSessionInfo flag

* revert: csrf load
This commit is contained in:
Barış Soner Uşaklı
2022-08-13 20:24:42 -04:00
committed by Julian Lam
parent 20a661e124
commit 33458701c1
5 changed files with 10 additions and 7 deletions

View File

@@ -35,7 +35,7 @@ module.exports = function (middleware) {
async function authenticate(req, res) {
async function finishLogin(req, user) {
const loginAsync = util.promisify(req.login).bind(req);
await loginAsync(user);
await loginAsync(user, { keepSessionInfo: true });
await controllers.authentication.onSuccessfulLogin(req, user.uid);
req.uid = user.uid;
req.loggedIn = req.uid > 0;