File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 11import  {  InternalCacheRequestConfig  }  from  "axios-cache-interceptor" ; 
2- import  {  BASE_URL  }  from  "@/constants/constants" ; 
2+ import  {  COURSES_URL ,   PUBLISHED_RESULTS_URL ,   RESULT_URL  }  from  "@/constants/constants" ; 
33import  Logger  from  "@/utils/logger" ; 
44import  {  axios  }  from  "../axios" ; 
55import  {  BypassData ,  getBypassData  }  from  "../utils/getBypassData" ; 
66import  {  getXToken  }  from  "../utils/getXToken" ; 
77
88const  logger  =  Logger . getLogger ( "INTERCEPTOR" ) ; 
99
10+ const  PROTECTED_URLS  =  [ COURSES_URL ,  RESULT_URL ,  PUBLISHED_RESULTS_URL ] ; 
11+ 
1012const  recaptchaInterceptor  =  async  ( config : InternalCacheRequestConfig )  =>  { 
11-   if  ( config . url ?. includes ( BASE_URL ) )  { 
13+   if  ( PROTECTED_URLS . some ( url   =>   config . url ?. includes ( url ) ) )  { 
1214    // Check if request is already cached, if so don't generate a new key 
1315    const  key  =  axios . generateKey ( config ) ; 
1416    const  cached  =  await  axios . storage . get ( key ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments