Prefent refresh loop

This commit is contained in:
rijkvanzanten
2020-07-30 14:37:22 -04:00
parent 963b2a59a5
commit 263c495b78

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 !== '/auth/refresh') {
if (status === 401 && code === 'INVALID_CREDENTIALS' && error.response?.config?.url?.includes('refresh') === false) {
try {
await refresh();