-
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
Missing auth headers in response to validate_token #944
Comments
I'm using React on the front end and I have observed what seems to be similar behavior, but for all API end points. If requests come too close together the server doesn't send headers, but if I give it about 5 sec in-between requests, it always sends. Our work around was to just save and send the last headers if no new ones were given. We sometimes can send up to 6 requests with the same headers before getting a new one. |
@nicholasshirley it's a known issue, requests made in short periods of time will not respond with credentials, but the last credential still works. Btw, I'd recommend build your own lib, this one is very buggy and is far from being production ready. For example, go to rails AMS repo and type this repo name and look at the comments. I also made the mistake from using libraries from @lynndylanhurley, he seems to put a lot of effort but the result was only a buggy authentication. You'd be better building your own library, it's not that hard. |
@betoharres that's not a bug. the order of the responses can't be guaranteed to the client. so if we include the credentials in every response, then the client may receive the outdated credentials after the last valid credentials. the only ways to handle it were to either include a timestamp for when each auth token was created, or to not include the token when the request was part of a batch of concurrent requests that all use the same token. the latter option was easier to deal with on both the client and API so we opted for that. |
@lynndylanhurley thanks for the explanation and sorry for my misunderstand about this. |
The way I'm working around this issue is to just code the handling of the auth headers in the response from |
I'm encountering what seems to be some sort of edge case with the
sign_in
andvalidate_token
routes.In my client app, I am calling the
sign_in
API, then immediately after calling thevalidate_token
API. What I am noticing is that if the calls happen to close together, the response fromvalidate_token
is missing the 'access-token', 'uid', etc.. headers.However, if I put a break point and wait long enough between the two API calls, the call to
validate_token
will return the headers in the response with the updated access-token.Is there some sort edge case here? The calls are happening synchronously as I'm using WEBrick with a single thread, so the API calls are not overlapping.
The text was updated successfully, but these errors were encountered: