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

Auth tokens can be given to the wrong user by simultaneous refresh requests #88

Closed
cbargren opened this issue Jun 2, 2016 · 1 comment
Labels

Comments

@cbargren
Copy link
Contributor

cbargren commented Jun 2, 2016

If two refresh requests happen concurrently, the tokens can get jumbled between the requests. Example:

Request A and Request B happen very close together. Request A begins a refresh call. Before Request A finishes, Request B begins a refresh call. Request A's refresh call finishes, storing the token in the access_token object. Request B's refresh call finishes, overwriting Request A's token. Request A's callback is triggered, handing Request B's token to request A's callback. Now Request A's user has Request B's user's token.

This is because of https://github.com/lelylan/simple-oauth2/blob/master/lib/client/access-token.js#L13 not creating a new instance to store the access token in, meaning there is a singleton to store the access token that can be overwritten by concurrent requests.

@johnhaley81
Copy link
Contributor

This can be closed.

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

Successfully merging a pull request may close this issue.

3 participants