Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

gustavguez-solcre
Copy link

Added a line configuration for the interceptor allows me to set up or not, buffer a request if a response returns me 403, and resend it after the user login. Similarly it happens with the error code 401.

There are servers that return 403 or API, when a token is expired. And it is highly questionable whether to return 401 or 403, so I think the configuration is correct.

So i change this:

case 403:
                $rootScope.$broadcast('event:auth-forbidden', rejection);
                break;
            }

to:

case 403:
                if(rejection.config.authForbiddenBuffer){
                    var deferred = $q.defer();
                    httpBuffer.append(rejection.config, deferred);
                    $rootScope.$broadcast('event:auth-forbidden', rejection);
                    return deferred.promise;
                }
                $rootScope.$broadcast('event:auth-forbidden', rejection);
                break;
            }

Schlogen and others added 30 commits November 12, 2013 11:51
Update http-auth-interceptor to use the new response interceptors. The current way is deprecated.
Described how to use the config updater function in an Advanced use case section. Have not changed anything, just added.
Updated README with configUpdater description
More documentation for loginConfirmed (#56)
Added support for HTTP 403 responses
Added specific detail to the advanced use cases to make them more clear.
At the very least include how to use this module. It's an awesome module, but extremely confusing documentation.
@witoldsz
Copy link
Owner

witoldsz commented Jul 6, 2015

What is that? A 41 commits long pull request?

@gustavguez-solcre
Copy link
Author

Sorry Witold, i do a pull request with wrong commits, you can solve this?

@witoldsz
Copy link
Owner

witoldsz commented Jul 6, 2015

I don't think so, it is your pull request. You can try if you can change target branch or if not, discard this and create new one.

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.