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
|
||||
}
|
||||
|
||||
@@ -6,17 +6,11 @@ meta {
|
||||
|
||||
get {
|
||||
url: {{url}}/lst/api/user/roles
|
||||
body: json
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"module":"users",
|
||||
"role":"admin"
|
||||
}
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
35
LogisticsSupportTool_API_DOCS/app/auth/Login.bru
Normal file
35
LogisticsSupportTool_API_DOCS/app/auth/Login.bru
Normal file
@@ -0,0 +1,35 @@
|
||||
meta {
|
||||
name: Login
|
||||
type: http
|
||||
seq: 10
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{url}}/lst/api/user/login
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"username": "cowch",
|
||||
"password": "Alpla2025!"
|
||||
}
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
// grab the raw Set-Cookie header
|
||||
const cookies = res.headers["set-cookie"];
|
||||
|
||||
const sessionCookie = cookies[0].split(";")[0];
|
||||
|
||||
// Save it as an environment variable
|
||||
bru.setEnvVar("session_cookie", sessionCookie);
|
||||
|
||||
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
@@ -21,4 +21,5 @@ body:json {
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
@@ -32,4 +32,5 @@ script:post-response {
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{url}}/lst/api/auth/session
|
||||
url: {{url}}/lst/api/auth/sign-out
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
@@ -25,4 +25,5 @@ script:post-response {
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
@@ -13,12 +13,12 @@ post {
|
||||
body:json {
|
||||
{
|
||||
"scannerId": 999,
|
||||
"lotNr": 26321,
|
||||
"machineId": 3, // 457=22, 458=23
|
||||
"printerId": 7, // 457=22, 458=23
|
||||
"layoutId": 25,
|
||||
"lotNr": 3314,
|
||||
"machineId": 22, // 457=22, 458=23
|
||||
"printerId": 22, // 457=22, 458=23
|
||||
"layoutId": 7,
|
||||
"numberOfCopies": 0,
|
||||
"qtyToPrint": 30
|
||||
"qtyToPrint": 3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
vars {
|
||||
url: http://localhost:5500
|
||||
session_cookie:
|
||||
urlv2: http://usmcd1vms036:3000
|
||||
urlv2: http://localhost:3000
|
||||
jwtV2:
|
||||
userID:
|
||||
}
|
||||
vars:secret [
|
||||
v2Password
|
||||
|
||||
Reference in New Issue
Block a user