33 lines
471 B
Text
33 lines
471 B
Text
meta {
|
|
name: session
|
|
type: http
|
|
seq: 2
|
|
}
|
|
|
|
get {
|
|
url: {{protocol}}//{{domain}}/auth/session
|
|
body: none
|
|
auth: bearer
|
|
}
|
|
|
|
headers {
|
|
Accept: application/json; charset=utf-8
|
|
}
|
|
|
|
auth:bearer {
|
|
token: {{authToken}}
|
|
}
|
|
|
|
script:post-response {
|
|
const body = res.getBody();
|
|
const data = body.data;
|
|
|
|
if (res.status < 300) {
|
|
bru.setEnvVar("userId", data.id);
|
|
|
|
if (data.session?.token) {
|
|
bru.setEnvVar("sessionToken", data.token);
|
|
}
|
|
}
|
|
|
|
}
|