Created
July 27, 2023 14:00
-
-
Save elshanx/07c3315f988b6249d4974dacbb890eb5 to your computer and use it in GitHub Desktop.
[Postman] Store access token automatically on [register, login] routes
This file contains 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
if (pm.response.code !== 200) { | |
return; | |
} | |
const response = pm.response.json(), | |
accessToken = response.data.token; | |
// Storing the access token in the environment to be used in other endpoints | |
pm.collectionVariables.set('accessToken', accessToken); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment