- 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
58 lines
1.0 KiB
Plaintext
58 lines
1.0 KiB
Plaintext
meta {
|
|
name: Logout User
|
|
type: http
|
|
seq: 1
|
|
}
|
|
|
|
post {
|
|
url: {{base_url}}/api/auth/logout
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
headers {
|
|
Content-Type: application/json
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"refresh_token": "{{refresh_token}}"
|
|
}
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Logout User
|
|
|
|
Logs out the user by revoking their refresh token. If no refresh token is provided, the request succeeds but no token is revoked.
|
|
|
|
**Method:** POST
|
|
|
|
**Endpoint:** /api/auth/logout
|
|
|
|
**Authentication:** Bearer token (optional)
|
|
|
|
**Request Body:**
|
|
- `refresh_token` (string, optional): Refresh token to revoke
|
|
|
|
**Response:**
|
|
- `message` (string): Success message
|
|
|
|
**Status Codes:**
|
|
- 200: Success - user logged out (token revoked if provided)
|
|
- 401: Unauthorized
|
|
|
|
**Example Response:**
|
|
```json
|
|
{
|
|
"message": "logged out successfully"
|
|
}
|
|
```
|
|
|
|
**Note:** The access token will expire naturally after 1 hour. The refresh token is immediately revoked on logout, preventing future token refreshes.
|
|
}
|