diff --git a/postman/collections/Expenses Server/API/Auth/Token/Refresh token.request.yaml b/postman/collections/Expenses Server/API/Auth/Token/Refresh token.request.yaml index 1cae21f..ebfd2f5 100644 --- a/postman/collections/Expenses Server/API/Auth/Token/Refresh token.request.yaml +++ b/postman/collections/Expenses Server/API/Auth/Token/Refresh token.request.yaml @@ -6,4 +6,13 @@ body: content: grant_type: refresh_token refresh_token: "{{refresh_token}}" +scripts: + - type: afterResponse + code: |- + var access_token = pm.response.json()["access_token"]; + pm.collectionVariables.set("access_token", access_token); + + var refresh_token = pm.response.json()["refresh_token"]; + pm.collectionVariables.set("refresh_token", refresh_token); + language: text/javascript order: 2000 diff --git a/postman/collections/Expenses Server/API/Auth/Token/Request token using client credentials.request.yaml b/postman/collections/Expenses Server/API/Auth/Token/Request token using client credentials.request.yaml index b9aba27..f63e3cb 100644 --- a/postman/collections/Expenses Server/API/Auth/Token/Request token using client credentials.request.yaml +++ b/postman/collections/Expenses Server/API/Auth/Token/Request token using client credentials.request.yaml @@ -14,6 +14,6 @@ scripts: pm.collectionVariables.set("access_token", access_token); var refresh_token = pm.response.json()["refresh_token"]; - pm.collectionVariables.set("refresh_token", access_token); + pm.collectionVariables.set("refresh_token", refresh_token); language: text/javascript order: 1000