title: How can I update the CSRF token when doing login via Ajax?
body: <p>If you do login via Ajax, the current CSRF token that is in the head gets unauthorized, so I need a way to update it.</p>
  
  <p>Taylor Otwell says the CSRF token is already returned as a cookie when doing login via Ajax (source: <a href="https://github.com/laravel/ui/pull/79#issuecomment-601719203" rel="nofollow noreferrer">https://github.com/laravel/ui/pull/79#issuecomment-601719203</a>), but it is not the case (see image below):</p>
  
  <p><a href="https://i.stack.imgur.com/v1OhF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v1OhF.png" alt="enter image description here"></a></p>
  
  <p>The reason I need to update the CSRF token is because in Apollo Client I have the following configuration:</p>
  
  <pre><code>const client = new ApolloClient({
    uri: '/graphql',
    headers: {
      'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content
    }
  });
  </code></pre>
  
  <p>Am I missing something? Any help is greatly appreciated.</p>
  
  <p>Thank you</p>