First Commit. AI Generated App.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
meta {
|
||||
name: Get Profile
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{base_url}}/api/auth/profile
|
||||
body: none
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
meta:
|
||||
name: Get Profile
|
||||
seq: 3
|
||||
http:
|
||||
method: get
|
||||
url: "{{base_url}}/api/auth/profile"
|
||||
auth:
|
||||
type: bearer
|
||||
docs: |
|
||||
## Get User Profile
|
||||
|
||||
Retrieves the profile of the authenticated user.
|
||||
|
||||
**Authentication:** Required (Bearer token)
|
||||
|
||||
**Response:**
|
||||
- `id` (string): User UUID
|
||||
- `email` (string): User's email address
|
||||
- `username` (string): User's username
|
||||
|
||||
**Error Responses:**
|
||||
- 401: Invalid or missing JWT token
|
||||
- 404: User not found
|
||||
@@ -0,0 +1,45 @@
|
||||
meta {
|
||||
name: Login User
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/auth/login
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"login": "test@example.com",
|
||||
"password": "password123"
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
meta:
|
||||
name: Login User
|
||||
seq: 2
|
||||
http:
|
||||
method: post
|
||||
url: "{{base_url}}/api/auth/login"
|
||||
body:
|
||||
type: json
|
||||
data: |
|
||||
{
|
||||
"login": "test@example.com",
|
||||
"password": "password123"
|
||||
}
|
||||
docs: |
|
||||
## Login User
|
||||
|
||||
Authenticates a user and returns a JWT token.
|
||||
|
||||
**Request Body:**
|
||||
- `login` (string, required): Email address or username
|
||||
- `password` (string, required): User's password
|
||||
|
||||
**Response:**
|
||||
- `token` (string): JWT authentication token (24h expiry)
|
||||
- `user` (object): User profile with id, email, username
|
||||
|
||||
**Error Responses:**
|
||||
- 401: Invalid credentials
|
||||
- 400: Invalid request data
|
||||
@@ -0,0 +1,47 @@
|
||||
meta {
|
||||
name: Register User
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{base_url}}/api/auth/register
|
||||
body: json
|
||||
auth: inherit
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"email": "test@example.com",
|
||||
"username": "testuser",
|
||||
"password": "password123"
|
||||
}
|
||||
}
|
||||
|
||||
settings {
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
}
|
||||
|
||||
docs {
|
||||
## Register User
|
||||
|
||||
Creates a new user account.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/auth/register
|
||||
|
||||
**Request Body:**
|
||||
- `email` (string): Email address
|
||||
- `username` (string): Username
|
||||
- `password` (string): Password
|
||||
|
||||
**Response:**
|
||||
- `token` (string): JWT token
|
||||
- `user` (object): User details
|
||||
|
||||
**Status Codes:**
|
||||
- 201: Created
|
||||
- 409: User exists
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
meta:
|
||||
name: Register User
|
||||
seq: 1
|
||||
http:
|
||||
method: post
|
||||
url: "{{base_url}}/api/auth/register"
|
||||
body:
|
||||
type: json
|
||||
data: |
|
||||
{
|
||||
"email": "test@example.com",
|
||||
"username": "testuser",
|
||||
"password": "password123"
|
||||
}
|
||||
docs: |
|
||||
## Register User
|
||||
|
||||
Creates a new user account with email, username, and password.
|
||||
|
||||
**Request Body:**
|
||||
- `email` (string, required): Valid email address
|
||||
- `username` (string, required): Unique username (3-50 chars)
|
||||
- `password` (string, required): Password (min 6 chars)
|
||||
|
||||
**Response:**
|
||||
- `token` (string): JWT authentication token
|
||||
- `user` (object): User profile with id, email, username
|
||||
|
||||
**Error Responses:**
|
||||
- 409: Email or username already exists
|
||||
- 400: Invalid request data
|
||||
Reference in New Issue
Block a user