Skip to content
Snippets Groups Projects
Commit 81c855f7 authored by Fabien Zucchet's avatar Fabien Zucchet
Browse files

debug

parent 836c9d1f
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,7 @@ function getAdminsLogins(req, res) {
return res.send({ success: false })
}
var data = result.map((item) => { return item.login });
console.log(data);
return res.send(data)
});
con.end();
......@@ -157,10 +158,10 @@ async function getUsersPerformance(req, res) {
}
}
async function isAdminMiddleware(req, res, next) {
unction isAdminMiddleware(req, res, next) {
console.log(req.session.ids);
const login = req.session.login || '';
const admins = await getAdminsLogins();
const admins = getAdminsLogins();
console.log(admins);
if (admins.includes(login)) {
return next();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment