Merge pull request #24 from richardassar/userKey_zero_val

Allow 0 value for serialized user (id)
This commit is contained in:
José F. Romaniello 2013-06-30 12:37:33 -07:00
commit 8ef08d5a07

View File

@ -55,10 +55,11 @@ function authorize(options) {
var userKey = session[ auth.passport._key ][ auth.userProperty ]; var userKey = session[ auth.passport._key ][ auth.userProperty ];
if( !userKey && auth.fail ) { if(userKey === undefined)
return auth.fail( data, accept ); if(auth.fail)
} else if( !userKey ) { return auth.fail( data, accept );
return accept(null, false); else
return accept(null, false);
} }
auth.passport.deserializeUser(userKey, function(err, user) { auth.passport.deserializeUser(userKey, function(err, user) {