Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticate callback info parameter returns empty object #78

Open
mleanos opened this issue Mar 7, 2016 · 0 comments
Open

Authenticate callback info parameter returns empty object #78

mleanos opened this issue Mar 7, 2016 · 0 comments

Comments

@mleanos
Copy link

mleanos commented Mar 7, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant