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

loginConfirmed: updater returns false to ignore request #127

Merged
merged 3 commits into from Mar 1, 2016
Merged

loginConfirmed: updater returns false to ignore request #127

merged 3 commits into from Mar 1, 2016

Conversation

migajek
Copy link
Contributor

@migajek migajek commented Feb 24, 2016

allow the request to be ignored from "retrying" when loginConfirmed's updater function returns false

allow the request to be ignored from "retrying" when loginConfirmed's updater function returns ``false``
@@ -122,7 +122,10 @@
*/
retryAll: function(updater) {
for (var i = 0; i < buffer.length; ++i) {
retryHttpRequest(updater(buffer[i].config), buffer[i].deferred);
var _cfg = updater(buffer[i].config);
if (_cfg === false)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why won't you call rejectAll instead? Is is that there are some events you want to abandon and some you want to be retried? What's the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is exactly the case. Some of the request are supposed to be retried,
others to be canceled.
29 lut 2016 14:35 "Witold Szczerba" notifications@github.com napisał(a):

In src/http-auth-interceptor.js
#127 (comment)
:

@@ -122,7 +122,10 @@
*/
retryAll: function(updater) {
for (var i = 0; i < buffer.length; ++i) {

  •      retryHttpRequest(updater(buffer[i].config), buffer[i].deferred);
    
  •      var _cfg = updater(buffer[i].config);
    
  •      if (_cfg === false)
    

Why won't you call rejectAll instead? Is is that there are some events
you want to abandon and some you want to be retried? What's the case?


Reply to this email directly or view it on GitHub
https://github.com/witoldsz/angular-http-auth/pull/127/files#r54409370.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about if (_cfg !== false) retryHttpRequest(_cfg, buffer[i].deferred); instead?
Also, it would be awesome if you could mention about this in documentation, most of users won't find this otherwise.

@migajek
Copy link
Contributor Author

migajek commented Mar 1, 2016

@witoldsz I've inverted the "if" statement and updated the docs. Please have a look :)

witoldsz added a commit that referenced this pull request Mar 1, 2016
loginConfirmed: updater returns false to ignore request
@witoldsz witoldsz merged commit fcc39c6 into witoldsz:master 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

Successfully merging this pull request may close these issues.

None yet

2 participants