I have a problem with user authentification in my app that runs on Node.Js / Express.Js
Basically, when the user logs in the main interface (html), they are shown a graph, which is obtained through an API path (/api/data/json), which also requires authentification through
exports.auth = express.basicAuth(User.authenticate);
in routes/api.js
I tried "telling" routes/api.js that the user is already authorized through passing it one of the res.locals.user parameters, but it didn't help...
So my question: is there any way in Node.Js to store user's login details in a session variable (like you can do in PHP for example), so that it's passed on to all the components when authorization is needed, to avoid users having to re-authorize when they access another part of the app?
Thank you!