ForbesLindesay / connect-roles

Provides dynamic roles based authorisation for node.js connect and express servers.
749 stars 62 forks source link

don't assume there is a req.user in the debug statement. fixes #21 #22

Closed mxriverlynn closed 10 years ago

mxriverlynn commented 11 years ago

Assuming there is a req.user is throwing an error when a user is not authenticated. I've added a simple work-around for this, to get either the req.user or {} if that does not exist, and make the debug check against that. Fixes #21

ForbesLindesay commented 10 years ago

Yes, this doesn't actually seem to do anything, it just declares an un-used variable. Also that debug expression already checks whether req.user exists and therefore doesn't throw if it doesn't exist.