fix bug calling both success and accept

This commit is contained in:
Jose F. Romaniello
2013-01-07 11:30:15 -03:00
parent 79878b036c
commit a1e46b1fbd
2 changed files with 15 additions and 11 deletions

View File

@ -46,15 +46,12 @@ function authorize(options) {
return accept(null, false);
}
if( auth.success ) {
auth.passport.deserializeUser(userKey, function(err, user) {
data[ auth.userProperty ] = user;
return auth.success( data, accept );
});
}
auth.passport.deserializeUser(userKey, function(err, user) {
data[ auth.userProperty ] = user;
return accept(null, true);
if( auth.success ) {
return auth.success( data, accept );
}
accept(null, true);
});
});