Forked from devajmeireles/gist:77951cd44f71da945d0a9de4d675d3bc
Created
March 26, 2024 02:10
-
-
Save LukasCCB/c864cc3adae705023d88992667998c06 to your computer and use it in GitHub Desktop.
Laravel Sanctum, Postman Pre-script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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