Files
bookhoard/bruno/auth/Register User.bru
T
john-okeefe e32fda6b65 Add user theme support and migrate frontend to HTMX templates
- Add theme column to users table with default 'tokyo-night'
- Update all user queries to include theme field
- Add ListUsers and UpdateUserTheme database queries
- Update auth handlers to support HTMX form submissions and JSON API
- Add ListUsers API endpoint
- Replace embedded static files with Go templates
- Update Dockerfile to copy templates directory
- Redesign index.html with inline styles and HTMX forms
- Update Bruno API testing requests for auth endpoints
2026-01-22 18:38:06 -05:00

60 lines
1015 B
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"
}
}
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
**Response:**
- `token` (string): JWT token
- `user` (object): User details
- `id` (string): User ID
- `email` (string): Email
- `username` (string): Username
- `theme` (string): User theme preference
**Status Codes:**
- 201: Created
- 409: User exists
}