Skip to content

Instantly share code, notes, and snippets.

@sadiqsalau
Last active April 1, 2024 17:48
Show Gist options
  • Save sadiqsalau/32b054dc42b4b0582e296b43efc7c496 to your computer and use it in GitHub Desktop.
Save sadiqsalau/32b054dc42b4b0582e296b43efc7c496 to your computer and use it in GitHub Desktop.
Thunder Client Laravel CSRF
  1. Open thunder client, switch to Env and create a local environment.
  2. Add a test to your collection by navigating to the Tests tab, then select Set Env Variable, set query to cookie.xsrf-token and value to {{XSRF-TOKEN, local}}
  3. In the Headers tab, add an header named X-XSRF-TOKEN with value {{XSRF-TOKEN | urlDecode}}.
  4. Create a request to /sanctum/csrf-cookie to refresh CSRF Token if it expires
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment