jaredhanson/passport-twitter

Authenticate callback info parameter returns empty object

mleanos opened this issue · 0 comments

I'm experiencing odd behavior with the passport.authenticate method's callback. I'm using the following signature.
passport.authenticate('twitter', function (err, user, info) {});

I'm passing the callback from a custom handler method like so
return done(err, user, info);

Sometimes info, when I pass it into my done callback, is null or undefined, which is the expected behavior in certain cases. In these cases instead the info parameter in the Authenticate callback is passed as an empty object rather than undefined or null. I would expect it to maintain the value that I sent to the done() callback.

I originally thought maybe this was behavior of the express middleware, but it doesn't appear that is the case. I'm using the middleware, and custom handler method for passport-facebook & the info parameter maintains it's value; undefined when I either omit the value or explicitly specify undefined.

Anyone see this type of bahavior, or understand why? It seems interesting to me that I'd see different behavior between the Twitter & Facebook packages in this case.