Prevent infinite refresh loop

This commit is contained in:
rijkvanzanten
2020-07-30 16:17:58 -04:00
parent 7416b80166
commit e9f2e1757a

View File

@@ -53,7 +53,7 @@ export const onError = async (error: RequestError) => {
/* istanbul ignore next */
const code = error.response?.data?.error?.code;
if (status === 401 && code === 'INVALID_CREDENTIALS' && error.response?.config?.url?.includes('refresh') === false) {
if (status === 401 && code === 'INVALID_CREDENTIALS' && error.request.responseURL.includes('refresh') === false) {
try {
await refresh();