Debug response

This commit is contained in:
NyxiumYuuki 2021-05-28 08:52:35 +02:00
parent 502de9b05a
commit e787258999
2 changed files with 9 additions and 6 deletions

View file

@ -32,11 +32,11 @@ async function authenticate(req, res) {
const userList = await queries.checkLoginQuery(login, password);
if (userList !== undefined && userList[0] !== undefined && userList[0].idUtilisateur > 0){
setSessionCookie (req, res, { userId: userList[0].idUtilisateur });
// return userList[0].idUtilisateur;
return getUserId(getSession(req));
console.log("check");
setSessionCookie (req, res, { username: login});
return userList[0].idUtilisateur;
} else {
setSessionCookie (req, res, {userId: -1});
setSessionCookie (req, res, {username: -1});
return -1;
}