Files
bookhoard/bruno/user/Register User.bru
T
john-okeefe 71584c1b55 feat: Enhance admin user management system
- Add admin override capability to DELETE /api/auth/account endpoint
- Move /api/auth/users to admin-only with complete user fields (first_name, last_name, role, theme)
- Consolidate Bruno requests: remove duplicate List Users (Admin), merge Delete Account functionality
- Update all documentation to reflect enhanced capabilities
- Implement pgx 5 standards compliance with proper error handling

BREAKING CHANGES:
- /api/auth/users endpoint now requires admin role (was previously accessible)
- DELETE /api/auth/account accepts optional user_id parameter for admin deletion
2026-01-27 13:36:11 -05:00

68 lines
1.4 KiB
Plaintext

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",
"first_name": "Test",
"last_name": "User"
}
}
script:post-response {
function onResponse(res) {
let data = res.getBody();
return bru.setEnvVar("token", data.token, { persist: true });
}
onResponse(res);
}
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
- `first_name` (string, optional): First name
- `last_name` (string, optional): Last name
- `role` (string): User role ("user" or "admin")
**Response:**
- `token` (string): JWT token
- `user` (object): User details
- `id` (string): User ID
- `email` (string): Email
- `username` (string): Username
- `theme` (string): User theme preference
- `first_name` (string, optional): First name
- `last_name` (string, optional): Last name
- `role` (string): User role ("user" or "admin")
**Status Codes:**
- 201: Created
- 409: User exists
}