ForbesLindesay / connect-roles

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

Debug statement throws error from missing poperty #21

Closed facultymatt closed 10 years ago

facultymatt commented 11 years ago

On line 93, the following code debug('Check Permission: ' + (req.user.id||req.user.name||"user") + throws an error when user is undefined - so basically any time the user is not authorized. The check itself works, it's just the debug statement that causes issues.

marcbenito commented 11 years ago

This error happens when we use passport as authentication module.

mxriverlynn commented 11 years ago

just ran in to this same problem w/ EveryAuth when i'm not logged in :(

ForbesLindesay commented 10 years ago

I just removed the debug statement, it wasn't hugely useful.