ammmir/node-oauth2-provider — pull request #39 by jsullivanlive (2013-11-06 01:33:42+00:00)
Title: ensure save emits are executed before we return to the user

A race condition happens when the user uses this express app to generate a token and then tries to use the access_token before the save transaction was successful with another app. The response to the user was happening for me several milliseconds earlier, leaving enough time for a server to beat the token to the database.