You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
what i use: createAuthRefreshInterceptor(instance, refreshAuthLogic, { statusCodes: [401, 403], pauseInstanceWhileRefreshing : true })
but have a situation. my project have multiple axios instance. so i use 'axios-auth-refresh' library. when api interface 401 or 403, mean token expired. so multiple axios will issue refresh api interface to get new token and new refresh token. by the way, in my project , refresh api interface need a params of refreshToken,and refreshToken only can use one time, if use more than one time, refresh api interface will append error.
so in multiple axios instance situation, the token expired and multiple axios instance request at the same time.
i use 'axios-auth-refresh' library, every axios instance will request refresh api, use the same refreshToken params. but only first request normal, the others request error, because refreshToken can only be use one time.
createAuthRefreshInterceptor(instance, refreshAuthLogic, { statusCodes: [401, 403], pauseInstanceWhileRefreshing : true })
and i think, in multiple axios instance, in fact, refreshAuthLogic function don't need to call refresh api multi time. only one time is ok. is better, right?
i fix it in the way. but is not better. i think 'axios-auth-refresh' can Encapsulate this functionality
The text was updated successfully, but these errors were encountered:
0zcl
changed the title
multiple axios. don't need to reqeuest refresh api multiple times
multiple axios instance. don't need to reqeuest refresh api multiple times
Oct 12, 2022
what i use:
createAuthRefreshInterceptor(instance, refreshAuthLogic, { statusCodes: [401, 403], pauseInstanceWhileRefreshing : true })
but have a situation. my project have multiple axios instance. so i use 'axios-auth-refresh' library. when api interface 401 or 403, mean token expired. so multiple axios will issue refresh api interface to get new token and new refresh token. by the way, in my project , refresh api interface need a params of refreshToken,and refreshToken only can use one time, if use more than one time, refresh api interface will append error.
so in multiple axios instance situation, the token expired and multiple axios instance request at the same time.
i use 'axios-auth-refresh' library, every axios instance will request refresh api, use the same refreshToken params. but only first request normal, the others request error, because refreshToken can only be use one time.
createAuthRefreshInterceptor(instance, refreshAuthLogic, { statusCodes: [401, 403], pauseInstanceWhileRefreshing : true })
and i think, in multiple axios instance, in fact, refreshAuthLogic function don't need to call refresh api multi time. only one time is ok. is better, right?
i fix it in the way. but is not better. i think 'axios-auth-refresh' can Encapsulate this functionality
The text was updated successfully, but these errors were encountered: