Answer the question
In order to leave comments, you need to log in
Are such checks sufficient when dealing with sessions in node.js?
Is such a simple check for the existence of a session generally acceptable? is it possible to bypass it?
module.exports.dashboard = (req, res, next) => {
if(!req.session.userId) {
next();
}
let data = {
title: 'Тайтл'
};
res.render('admin/index', data);
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question