Closed jedmundo closed 9 years ago
When you do this:
app.get('/*', function(req, res) { var role = userRoles.public, username = ''; if(req.user) { role = req.user.role; username = req.user.username; } res.cookie('user', JSON.stringify({ 'username': username, 'role': role })); res.sendfile('./public/index.html'); });
How do you get the user to get passed to req.user from the client side?? I just cant find how you do it :\
I noticed this come from http session variables!
When you do this:
app.get('/*', function(req, res) { var role = userRoles.public, username = ''; if(req.user) { role = req.user.role; username = req.user.username; } res.cookie('user', JSON.stringify({ 'username': username, 'role': role })); res.sendfile('./public/index.html'); });
How do you get the user to get passed to req.user from the client side?? I just cant find how you do it :\