Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 211 | Rev 214 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 211 Rev 213
Línea 32... Línea 32...
32
}
32
}
33
axios.interceptors.request.use(
33
axios.interceptors.request.use(
34
  async (config) => {
34
  async (config) => {
35
    if (['post', 'put', 'delete'].includes(config.method)) {
35
    if (['post', 'put', 'delete'].includes(config.method)) {
36
      const csrf = await axios.get('/csrf');
36
      const csrf = await axios.get('/csrf');
-
 
37
      if(csrf.data.success){
-
 
38
        config.headers['x-csrftoken'] = csrf.data.data
-
 
39
      }
37
      console.log('>>: csrf > ', csrf);
40
      console.log('>>: csrf > ', csrf);
38
    }
41
    }
39
    return config;
42
    return config;
40
  },
43
  },
41
  (error) => {
44
  (error) => {