refactor(front end): login fixes to account for the forced password change
This commit is contained in:
32
LogisticsSupportTool_API_DOCS/LstV2/Auth/Get Roles.bru
Normal file
32
LogisticsSupportTool_API_DOCS/LstV2/Auth/Get Roles.bru
Normal file
@@ -0,0 +1,32 @@
|
||||
meta {
|
||||
name: Get Roles
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{urlv2}}/api/auth/getuseraccess
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
headers {
|
||||
Content-Type: application/json
|
||||
Cookie: {{session_cookie}}
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"username": "matthes01",
|
||||
"password": "{{v2Password}}"
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
bru.setEnvVar("jwtV2",res.body.token)
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
@@ -22,9 +22,19 @@ body:json {
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
bru.setEnvVar("jwtV2",res.body.token)
|
||||
// grab the raw Set-Cookie header
|
||||
const cookies = res.headers["set-cookie"];
|
||||
|
||||
// cookies is usually an array, e.g. ["auth_session=abcd123; Path=/; HttpOnly; Secure; SameSite=Lax"]
|
||||
|
||||
// Extract just the value part ("auth_session=abcd123")
|
||||
const sessionCookie = cookies[0].split(";")[0];
|
||||
|
||||
// Save it as an environment variable
|
||||
bru.setEnvVar("session_cookie", sessionCookie);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user