Account change details (#5190)

## Summary
Accounts setting page to change a users password or username
Fix huge bug were users can see admin settings due to hard code
admin=true
## Testing
- not run (not requested)

------
[Codex
Task](https://chatgpt.com/codex/tasks/task_b_6934b8ecdbf08328a0951b46db77dfd2)
This commit is contained in:
Anthony Stirling
2025-12-11 13:56:35 +00:00
committed by GitHub
parent eb3e57577c
commit 5f072f87bb
7 changed files with 331 additions and 54 deletions
@@ -69,7 +69,7 @@ const AppConfigModalInner: React.FC<AppConfigModalProps> = ({ opened, onClose })
}), []);
// Get isAdmin and runningEE from app config
const isAdmin = true // config?.isAdmin ?? false;
const isAdmin = config?.isAdmin ?? false;
const runningEE = config?.runningEE ?? false;
const loginEnabled = config?.enableLogin ?? false;
@@ -3,6 +3,7 @@ export const VALID_NAV_KEYS = [
'preferences',
'notifications',
'connections',
'account',
'general',
'people',
'teams',
@@ -56,4 +56,14 @@ export const accountService = {
formData.append('newPassword', newPassword);
await apiClient.post('/api/v1/user/change-password-on-login', formData);
},
/**
* Change username
*/
async changeUsername(newUsername: string, currentPassword: string): Promise<void> {
const formData = new FormData();
formData.append('currentPasswordChangeUsername', currentPassword);
formData.append('newUsername', newUsername);
await apiClient.post('/api/v1/user/change-username', formData);
},
};