Tidied up Bruno files.
This commit is contained in:
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://localhost:3000/api/auth/login
|
||||
url: "{{BASE_URL}}/api/auth/login"
|
||||
headers:
|
||||
- name: Content-Type
|
||||
value: application/json
|
||||
@@ -18,6 +18,16 @@ http:
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: after-response
|
||||
code: |-
|
||||
function onResponse(res) {
|
||||
console.log(res.getHeader('set-cookie'));
|
||||
bru.setEnvVar("REFRESH_COOKIE", res.getHeader('set-cookie'));
|
||||
}
|
||||
onResponse(res);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
@@ -5,12 +5,22 @@ info:
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://localhost:3000/api/auth/token
|
||||
url: "{{BASE_URL}}/api/auth/token"
|
||||
headers:
|
||||
- name: Cookie
|
||||
value: refresh=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1IjoiMSIsInIiOiIxIiwiaWF0IjoxNzcxNTk3NjQ2LCJleHAiOjE3NzQxODk2NDZ9.07ViS5Nie3Bi2OgnlHyybDNZ9bdXPRRiqO-RFLhjoKo; Path=/; Max-Age=2592000; Secure; HttpOnly; SameSite=Lax
|
||||
value: "{{REFRESH_COOKIE}}"
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: after-response
|
||||
code: |-
|
||||
function onResponse(res) {
|
||||
let data = res.getBody();
|
||||
bru.setEnvVar("BEARER_TOKEN", data.token);
|
||||
}
|
||||
onResponse(res);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
|
||||
Reference in New Issue
Block a user