Complete project cleanup: remove unneeded files, organize static assets, update .gitignore
This commit is contained in:
@@ -17,20 +17,20 @@ settings {
|
||||
|
||||
docs {
|
||||
## Get User Profile
|
||||
|
||||
|
||||
Retrieves the authenticated user's profile.
|
||||
|
||||
|
||||
**Method:** GET
|
||||
|
||||
|
||||
**Endpoint:** /api/auth/profile
|
||||
|
||||
|
||||
**Authentication:** Required
|
||||
|
||||
|
||||
**Response:**
|
||||
- `id` (string): User ID
|
||||
- `email` (string): Email
|
||||
- `username` (string): Username
|
||||
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Unauthorized
|
||||
|
||||
+28
-20
@@ -17,29 +17,37 @@ body:json {
|
||||
}
|
||||
}
|
||||
|
||||
docs {
|
||||
## Login User
|
||||
|
||||
Authenticates a user with email/username and password.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/auth/login
|
||||
|
||||
**Request Body:**
|
||||
- `login` (string): Email or username
|
||||
- `password` (string): Password
|
||||
|
||||
**Response:**
|
||||
- `token` (string): JWT token
|
||||
- `user` (object): User details
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Invalid credentials
|
||||
script:post-response {
|
||||
function onResponse(res) {
|
||||
let data = res.getBody();
|
||||
let token = bru.setEnvVar("token", data.token, { persist: true });
|
||||
}
|
||||
onResponse(res);
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Login User
|
||||
|
||||
Authenticates a user with email/username and password.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/auth/login
|
||||
|
||||
**Request Body:**
|
||||
- `login` (string): Email or username
|
||||
- `password` (string): Password
|
||||
|
||||
**Response:**
|
||||
- `token` (string): JWT token
|
||||
- `user` (object): User details
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success
|
||||
- 401: Invalid credentials
|
||||
}
|
||||
|
||||
@@ -23,6 +23,13 @@ settings {
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
script:post-response {
|
||||
const data = res.getBody();
|
||||
if (res.getStatusCode() === 201) {
|
||||
bru.setEnvVar("token", data.token);
|
||||
}
|
||||
}
|
||||
|
||||
docs {
|
||||
## Register User
|
||||
|
||||
|
||||
Reference in New Issue
Block a user