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

How angular-http-auth-buffer works ? #125

Closed
toben opened this issue Feb 9, 2016 · 2 comments
Closed

How angular-http-auth-buffer works ? #125

toben opened this issue Feb 9, 2016 · 2 comments

Comments

@toben
Copy link

toben commented Feb 9, 2016

Hi,

I am using the module http-auth-buffer.
For my test, I give for the user a token which expires in 10 seconds. When I log in, my user goes on a page which does 5 requests to my web api. I wait 10 seconds, then I refresh the page. The buffer works because it calls only once my api.com/Token and then it calls my 5 requests..
But, the buffer doesn't work when I don't refresh but go on an other view. In this case, it calls 3 api.com/Token so the first one works, but the others fail because the first one change the refresh_token...

@witoldsz
Copy link
Owner

Hi,
I am sorry, I can't help you much in this very case. It would be best if you could look here:
src.js line 27 and here: src.js line 37. This is the place that propagates the buffer: src.js line 59
The source code of that buffer is here: src.js line 77

I hope that helps!

@witoldsz
Copy link
Owner

One more thing, check out that updater argument passed to the buffer on login confirmed. It allows you to inject a transformation function to the buffered requests just before retrying the requests (like maybe changing the tokens in your case?)

@witoldsz witoldsz closed this as completed Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants