Created
March 25, 2024 22:45
-
-
Save devajmeireles/77951cd44f71da945d0a9de4d675d3bc 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