- Convert all existing .bru files from JSON to Bruno DSL format - Remove obsolete files (conflicts/api.bru, kobo/Kobo Initialization.bru) - Update auth configuration to use 'inherit' instead of explicit bearer tokens - Add comprehensive documentation to all test files - Improve test scripts with proper assertions and error handling
69 lines
1.4 KiB
Plaintext
69 lines
1.4 KiB
Plaintext
meta {
|
|
name: Refresh Access Token
|
|
type: http
|
|
seq: 1
|
|
}
|
|
|
|
post {
|
|
url: {{base_url}}/api/auth/refresh
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
headers {
|
|
Content-Type: application/json
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"refresh_token": "{{refresh_token}}"
|
|
}
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Refresh Access Token
|
|
|
|
Refreshes an access token using a valid refresh token. Returns a new access token with 1-hour expiration.
|
|
|
|
**Method:** POST
|
|
|
|
**Endpoint:** /api/auth/refresh
|
|
|
|
**Authentication:** Not required (refresh token is in request body)
|
|
|
|
**Request Body:**
|
|
- `refresh_token` (string): Valid refresh token UUID
|
|
|
|
**Response:**
|
|
- `access_token` (string): New JWT access token (1 hour expiration)
|
|
- `token_type` (string): Token type (usually "Bearer")
|
|
- `expires_in` (number): Token lifetime in seconds (3600)
|
|
|
|
**Status Codes:**
|
|
- 200: Success - new access token generated
|
|
- 401: Unauthorized - invalid or expired refresh token
|
|
|
|
**Example Response (Success):**
|
|
```json
|
|
{
|
|
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
"token_type": "Bearer",
|
|
"expires_in": 3600
|
|
}
|
|
```
|
|
|
|
**Example Response (Invalid Token):**
|
|
```json
|
|
{
|
|
"error": "invalid or expired refresh token"
|
|
}
|
|
```
|
|
|
|
**Note:** Access tokens expire after 1 hour. Use the refresh token to obtain a new access token without requiring the user to log in again.
|
|
}
|