-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Batch Requests Respond with Original Auth Token #17
Comments
I did some playing around in the example angular consumer at (http://ng-token-auth-demo.herokuapp.com/) and noticed that it has the same behavior. It occurs nondeterministically depending on whether or not the first request or the second request responds first. I added some simple request and response token dumping via Chrome dev tools. After logging in, I hit the "Multiple Parallel Requests" button, saw that the original auth token was returned back, and then attempted to make a single request. That request failed because it used the old token (xZw...) and not the updated token (n8h..) for the third request.
|
Thanks @seckenrode, I'll investigate this immediately. |
@seckenrode - This seems to have been fixed in the demo. Please check out version |
I've noticed some strange behavior with batch requests that is causing parallel requests to return outdated auth tokens in the response. Essentially the situation is as follows:
Changing the batch request tests to start with a clean token by adding
age_token
at the start of the begin at line 153 ofdemo_controller_test.rb
causes reproducible test failures because the responses do not include the same response header.On its face, this seems due to the fact that extending the batch buffer actually does just return the auth token that was sent with the request as the response headers (https://github.com/lynndylanhurley/devise_token_auth/blob/master/app/models/devise_token_auth/concerns/user.rb#L132)
I'm working on my own angular consumer of this gem and am wondering if I need to be accounting for this behavior on the frontend or if this is behavior that is unexpected.
The text was updated successfully, but these errors were encountered: