I will get the JWT token as response i need to set that JWT token as environment variable in postman this is my code
pm.test("access_token is working", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.access_token).to.exist;
});
pm.environment.set("jwt_token", pm.test);
and when ever the JWT token changes the postman environment variable should set as that new value
This would be all you need to set the token:
pm.environment.set("jwt_token", pm.response.json().access_token)
Ensure that you have an environment created and selected in the drop down, in the top right of the app before making the request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With