ForbesLindesay / connect-roles

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

Better error checking #19

Closed nathasm closed 10 years ago

nathasm commented 11 years ago

Make sure that the user object exists before trying to inspect properties on user.

Prior to this change, the failureHandler would never be called because the Express error handler would capture the attempt to reference id on user, which in some cases user is undefined.

ForbesLindesay commented 10 years ago

It should be possible to have some things that an un-authenticated user can do. e.g. user.can('log in')