fnakstad / angular-client-side-auth

One way to implement authentication/authorization in Angular applications
http://angular-client-side-auth.herokuapp.com/
MIT License
1.63k stars 346 forks source link

Question about passing the user to HTTP GET * #97

Closed jedmundo closed 9 years ago

jedmundo commented 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 :\

jedmundo commented 9 years ago

I noticed this come from http session variables!