Clicking the send button should create an environmental variable for the JWT token. However the postman log outputs an error:
Here is the javascript code that should handle creating the access token as an environmental variable within postman.
var jsonData = JSON.parse(responseBody);
tests["Access token was not empty"] = jsonData.access_token !== undefined;
postman.environment.set("jwt_token", jsonData.access_token);
New test script for postman is
var jsonData = JSON.parse(responseBody);
pm.test("Access token was not empty", () => {
pm.expect(jsonData.access_token).not.eql(undefined);
});
pm.environment.set("jwt_token", jsonData.access_token);