Skip to content

Instantly share code, notes, and snippets.

@eguicciardi
Created April 11, 2022 08:20
Show Gist options
  • Save eguicciardi/714a6356976f241dfa96fd0a95caaac5 to your computer and use it in GitHub Desktop.
Save eguicciardi/714a6356976f241dfa96fd0a95caaac5 to your computer and use it in GitHub Desktop.
Set JWT Token with Postman
try {
// If access.token is returned, save it on the collection variable "jwtToken"
var jwtToken = pm.response.json()?.access?.token || false;
if(jwtToken) {
pm.collectionVariables.set("jwtToken", jwtToken);
}
} catch(error) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment