How to get User object? And how to make it available only for logged in users, like authorize flag in regular route.
I know, i cat get req.header.cookies and to manipulate this data, but is there another solutions?
function download(req, res, isValid) {
if (isValid)
return req.url.indexOf('.exe') !== -1;
framework.onAuthorization(req, res, req.flags, function(isLogged, user) {
if (!isLogged) {
framework.response401(req, res);
return;
}
req.user = user;
// HERE HERE - your code here
});
};