CSRF InvalidAuthenticityToken with rails and react
问题 I can't get my code working with the CSRF-Token. I have a axiosconfig file where I setup axios and export it: import axios from 'axios' const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content') const instance = axios.create({ baseURL: 'http://api.domain.tld/v1/', headers: { 'X-CSRF-Token': csrfToken } }); export default instance and my react component where I import it: import axios from '../config/axios' in my form on submit I fire this Post: axios .post('