File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,8 @@ client.interceptors.response.use(
6363
6464 const originalRequest = error . config ;
6565
66- if ( ! originalRequest ) return Promise . reject ( error ) ;
67-
68- if ( originalRequest . url === '/auth/reissue' ) {
69- logout ( ) ;
66+ if ( ! originalRequest || originalRequest . url === '/auth/reissue' ) {
67+ if ( isLoggedIn ) logout ( ) ;
7068 return Promise . reject ( error ) ;
7169 }
7270
@@ -77,6 +75,9 @@ client.interceptors.response.use(
7775 originalRequest . _retry = true ;
7876
7977 if ( isRefreshing ) {
78+ console . log ( 'request' , originalRequest ) ;
79+ console . log ( 'isRefreshing' ) ;
80+ console . log ( 'failedQueue' , failedQueue ) ;
8081 try {
8182 return new Promise ( ( resolve , reject ) => {
8283 failedQueue . push ( {
@@ -107,7 +108,8 @@ client.interceptors.response.use(
107108 }
108109 }
109110 }
110- logout ( ) ;
111+ if ( isLoggedIn ) logout ( ) ;
112+ console . error ( 'Failed to refresh token' , error ) ;
111113 return Promise . reject ( error ) ;
112114 } ,
113115) ;
You can’t perform that action at this time.
0 commit comments