Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LukasCCB/c864cc3adae705023d88992667998c06 to your computer and use it in GitHub Desktop.
Save LukasCCB/c864cc3adae705023d88992667998c06 to your computer and use it in GitHub Desktop.
Laravel Sanctum, Postman Pre-script
pm.sendRequest({
url: pm.environment.get('APP_URL') + 'sanctum/csrf-cookie',
method: 'GET'
}, function (error, response, { cookies }) {
if (!error) {
pm.environment.set('XSRF_TOKEN', cookies.get('XSRF-TOKEN'))
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment