Skip to content

Commit

Permalink
Merge pull request #3 from mjsarfatti/fix-handle-network-error
Browse files Browse the repository at this point in the history
Fixing useless second attempt in case of CORS failure
  • Loading branch information
Flyrell authored Dec 19, 2018
2 parents b40cbc8 + 53607a9 commit d331da6
Show file tree
Hide file tree
Showing 3 changed files with 505 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function createAuthRefreshInterceptor (axios, refreshTokenCall) {
const id = axios.interceptors.response.use(res => res, error => {

// Reject promise if the error status is not 401 (Unauthorized)
if (error.response && error.response.status !== 401) {
if (!error.response || (error.response && error.response.status !== 401)) {
return Promise.reject(error);
}

Expand Down
Loading

0 comments on commit d331da6

Please sign in to comment.