- 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
50 lines
913 B
Plaintext
50 lines
913 B
Plaintext
meta {
|
|
name: Update Password
|
|
type: http
|
|
seq: 3
|
|
}
|
|
|
|
put {
|
|
url: {{base_url}}/api/user/password
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
body {
|
|
{
|
|
"current_password": "currentpassword",
|
|
"new_password": "newpassword123",
|
|
"confirm_password": "newpassword123"
|
|
}
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Update Password
|
|
|
|
Updates the authenticated user's password.
|
|
|
|
**Method:** PUT
|
|
|
|
**Endpoint:** /api/user/password
|
|
|
|
**Authentication:** Required
|
|
|
|
**Request Body:**
|
|
- `current_password` (string, required): Current password for verification
|
|
- `new_password` (string, required): New password (minimum 6 characters)
|
|
- `confirm_password` (string, required): Confirmation of new password
|
|
|
|
**Response:**
|
|
- `message` (string): Success message
|
|
|
|
**Status Codes:**
|
|
- 200: Success
|
|
- 400: Password validation failed
|
|
- 401: Current password incorrect
|
|
- 401: Unauthorized
|
|
} |