feat: add user preferences dashboard

- Add /preferences route and preferences.html template for user settings
- Implement username, email, password, and theme update functionality
- Add account deletion feature with confirmation
- Add navigation link to preferences from dashboard
- Create API endpoints:
  - PUT /api/user/username - Update username
  - PUT /api/user/email - Update email address
  - PUT /api/user/password - Change password with verification
  - DELETE /api/user/account - Delete user account
- Add database queries for user updates and account deletion
- Create Bruno API testing files for all user preference endpoints
- Add proper validation, error handling, and security checks
This commit is contained in:
2026-01-23 09:30:15 -05:00
parent c29183a14f
commit 2dba1d6eb9
11 changed files with 628 additions and 15 deletions
+46
View File
@@ -0,0 +1,46 @@
meta {
name: Update Email
type: http
seq: 2
}
put {
url: {{base_url}}/api/user/email
body: json
auth: inherit
}
body {
{
"email": "newemail@example.com"
}
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## Update Email
Updates the authenticated user's email address.
**Method:** PUT
**Endpoint:** /api/user/email
**Authentication:** Required
**Request Body:**
- `email` (string, required): New email address (must be valid email format)
**Response:**
- `message` (string): Success message
**Status Codes:**
- 200: Success
- 400: Invalid email format
- 401: Unauthorized
- 409: Email already taken
}