react-native-simple-networking
Advanced tools
Comparing version
@@ -176,4 +176,7 @@ "use strict"; | ||
if ('response' in error && error.response && (attemptRefreshOnStatusCodes.includes(error.response.status))) { | ||
if (!authStore.getState().refreshToken) | ||
if (!authStore.getState().refreshToken) { | ||
logAxiosError(error); | ||
throw error; | ||
} | ||
; | ||
return await onUnauthorizedRequest(error.config); | ||
@@ -180,0 +183,0 @@ } |
{ | ||
"name": "react-native-simple-networking", | ||
"version": "1.0.60", | ||
"version": "1.0.61", | ||
"description": "This is a package that implements authentication state using zustand tied to axios interceptors in order to automatically add an 'authorization' header to all requests any time a request is sent with the created axios client. It also provides some basic request logging. The package will attempt to refresh any time an access token is expired, stalling all requests any time a token refresh is going on. ", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -199,3 +199,6 @@ import axios, { AxiosError, AxiosRequestConfig } from "axios"; | ||
if ('response' in error && error.response && (attemptRefreshOnStatusCodes.includes(error.response.status))) { | ||
if(!authStore.getState().refreshToken) throw error; | ||
if(!authStore.getState().refreshToken) { | ||
logAxiosError(error); | ||
throw error | ||
}; | ||
return await onUnauthorizedRequest(error.config); | ||
@@ -202,0 +205,0 @@ } else { |
39302
0.35%954
0.63%