I'm using Node.js, Express, Handlebars and trying to make an interface to manage user's roles and display a list of all the user names and I have a login button that changes to the username of the current user logged in but when I call my user.js model with user: user only displays all users but the current logged in username is not displayed and if I use the user: req.user it only shows the current user logged in.
how do I go about doing both on the same page?
here is my code
router.get('/', LogingCheck, roleAuth, (req, res, next) => {
User.find((err, user) => {
if (err) { console.log(err); }
else {
res.render('admin/index', { title: 'Role Manager', user: user, });
}
});
});
I then call the username for the current user like so {{user.username}} then call the list of usernames like so {{this.username}}