refactor: remove auth inherit and token handling from login request
- Remove 'auth: inherit' from POST request configuration - Remove post-response script that set token environment variable - Clean up documentation formatting This simplifies the login request configuration as authentication will now be handled via HTTP-only cookies instead of bearer tokens.
This commit is contained in:
@@ -7,7 +7,6 @@ meta {
|
|||||||
post {
|
post {
|
||||||
url: {{base_url}}/api/auth/login
|
url: {{base_url}}/api/auth/login
|
||||||
body: json
|
body: json
|
||||||
auth: inherit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body:json {
|
body:json {
|
||||||
@@ -17,23 +16,6 @@ body:json {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test credentials align with Go integration tests
|
|
||||||
// See TEST_DATA.md for shared test data documentation
|
|
||||||
|
|
||||||
script:post-response {
|
|
||||||
function onResponse(res) {
|
|
||||||
let data = res.getBody();
|
|
||||||
// If successful registration, set token environment variable
|
|
||||||
if (res.getStatus() === 201 || res.getStatus() === 200) {
|
|
||||||
if (data && data.access_token) {
|
|
||||||
|
|
||||||
return bru.setEnvVar("token", data.access_token, { persist: true });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onResponse(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
settings {
|
settings {
|
||||||
encodeUrl: true
|
encodeUrl: true
|
||||||
timeout: 0
|
timeout: 0
|
||||||
@@ -41,17 +23,17 @@ settings {
|
|||||||
|
|
||||||
docs {
|
docs {
|
||||||
## Login User
|
## Login User
|
||||||
|
|
||||||
Authenticates a user with email/username and password.
|
Authenticates a user with email/username and password.
|
||||||
|
|
||||||
**Method:** POST
|
**Method:** POST
|
||||||
|
|
||||||
**Endpoint:** /api/auth/login
|
**Endpoint:** /api/auth/login
|
||||||
|
|
||||||
**Request Body:**
|
**Request Body:**
|
||||||
- `login` (string): Email or username
|
- `login` (string): Email or username
|
||||||
- `password` (string): Password
|
- `password` (string): Password
|
||||||
|
|
||||||
**Response:**
|
**Response:**
|
||||||
- `token` (string): JWT token
|
- `token` (string): JWT token
|
||||||
- `user` (object): User details
|
- `user` (object): User details
|
||||||
@@ -61,7 +43,7 @@ docs {
|
|||||||
- `theme` (string): User theme preference
|
- `theme` (string): User theme preference
|
||||||
- `first_name` (string): First name
|
- `first_name` (string): First name
|
||||||
- `last_name` (string): Last name
|
- `last_name` (string): Last name
|
||||||
|
|
||||||
**Status Codes:**
|
**Status Codes:**
|
||||||
- 200: Success
|
- 200: Success
|
||||||
- 401: Invalid credentials
|
- 401: Invalid credentials
|
||||||
|
|||||||
Reference in New Issue
Block a user