title: Configuring CSRF tokens with apollo client and graphene-django
body: <p>I am having trouble properly setting up csrf tokens in the authlink header.</p>
  <pre><code>const authLink = setContext((_, { headers }) =&gt; {
      const token = localStorage.getItem(AUTH_TOKEN)
    return {
      &quot;headers&quot;: {
        'X-CSRFToken' : getCookie('csrftoken'),
        &quot;Authorization&quot;: token ? `JWT ${token}` : '',
        ...headers,
      },
    };
  });
  </code></pre>
  <p>The request being sent looks ok from the browser devtools, as you can see at the bottom the csrf token looks right? I cleared my browser data to make sure it wasn't old, but I'm not sure if that's effective anyways.</p>
  <pre><code>accept: */*
  Accept-Encoding: gzip, deflate, br
  Accept-Language: en-US,en;q=0.9
  Authorization
  Connection: keep-alive
  Content-Length: 505
  content-type: application/json
  Host: localhost:8000
  Origin: http://localhost:3000
  Referer: http://localhost:3000/
  Sec-Fetch-Dest: empty
  Sec-Fetch-Mode: cors
  Sec-Fetch-Site: same-site
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 Edg/89.0.774.63
  X-CSRFToken: LsV83sz3Rb5RRIlNcRN3AgnniodwsSMpvXwMGquPGRbvoPpISfKv6MBEf86rVzVp
  </code></pre>
  <p>The error I get through the site is
  CSRF verification failed. Request aborted</p>
  <p>my django server shows
  Forbidden (CSRF cookie not set.)</p>