travist/flatiron-passport — pull request #8 by pvorb (2013-04-05 11:23:08+00:00)
Title: Avoid unnecessarily emitting 'next' during authentication

I think I found and fixed a bug in the `authenticate()` function.

I am using MongoDB to store and retrieve session ids, that are used with [oauth2orize](//github.com/jaredhanson/oauth2orize). The entire setup is too complex to be described here. Long story short, when I had some truly asynchronous calls before a response was generated, an exception was thrown.

When I change your code to return after making the callback (see the [diff](https://github.com/pvorb/flatiron-passport/pull/new/patch-2#files_bucket)) and thus avoid to emit `'next'`, that bug doesn't occur anymore.

Could you please check if this breaks any existing behavior and, if it doesn't, merge that and update the npm package? This change is crucial to the application I'm working on.