I'm building a node + express app, and i need to pass the login data in every route, like this:
app.get('/dashboard', isLoggedIn, (req, res) => {
res.render('dashboard/dashboard', { user: req.user });
});
There's a way to always pass req.user as user to the view? (I'm using EJS btw)
I already have a middleware to check if the user is logged, or he will be redirected to login.
Thanks!