优化
This commit is contained in:
+1
-1
@@ -95,7 +95,7 @@ transport.interceptors.response.use(
|
||||
(response) => response,
|
||||
async (error: AxiosError) => {
|
||||
const request = error.config as RetryableRequest | undefined
|
||||
const publicAuthPaths = ['/auth/login', '/auth/register', '/auth/refresh']
|
||||
const publicAuthPaths = ['/auth/login', '/auth/register', '/auth/refresh', '/auth/impersonations/exchange']
|
||||
const isPublicAuthRequest = publicAuthPaths.some((path) => request?.url?.endsWith(path))
|
||||
if (error.response?.status !== 401 || !request || request._retriedAfterRefresh || isPublicAuthRequest) {
|
||||
throw mapError(error)
|
||||
|
||||
Reference in New Issue
Block a user