feat: document user management system and RBAC implementation
- Update copilot-instructions.md with user model, API routes, and frontend patterns - Update README.md with RBAC details, user management API, and security sections - Add user management technical documentation to TECH-CHANGELOG.md - Bump version to 2025.1.0-alpha.13 with user management changelog entries
This commit is contained in:
@@ -31,6 +31,26 @@ export interface AuthCheckResponse {
|
||||
role?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change password for the currently authenticated user.
|
||||
*/
|
||||
export async function changePassword(currentPassword: string, newPassword: string): Promise<{ message: string }> {
|
||||
const res = await fetch('/api/auth/change-password', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({ current_password: currentPassword, new_password: newPassword }),
|
||||
});
|
||||
|
||||
const data = await res.json();
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(data.error || 'Failed to change password');
|
||||
}
|
||||
|
||||
return data as { message: string };
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate a user with username and password.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user