You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor the password-change flow in app/Controllers/Home.php to improve readability and reduce nesting while preserving its behavior.
Consider private helpers for the shared admin-or-self authorization check, verification of the logged-in employee's current password, and repeated password-change JSON responses. Use early returns where useful. Keep the authorization responses for getChangePassword() and postSave() distinct.
Acceptance criteria
getChangePassword() and postSave() retain their admin-or-self authorization behavior and existing 403 response formats.
An admin changing another employee's password must verify the logged-in admin's current password. A submitted username must not change the verification identity or the account username.
Password length validation, hashing, save behavior, and existing success and failure response formats remain unchanged.
Controller-level tests cover admin and non-admin targets, invalid current passwords, short passwords, save failures, and response formats.
Status: Still present / not yet implemented on master.
app/Controllers/Home.php on master still contains the original, unrefactored password-change flow: getChangePassword() and postSave() both duplicate the admin-or-self authorization check (!$this->employee->isAdmin($currentPersonId) && $employeeId !== $currentPersonId) inline, and postSave() repeats the same JSON response shape (success/message/id) in multiple branches with a deeply nested if/else rather than early returns or private helpers. There are no private helper methods for the authorization check, current-password verification, or response building, and no app/Controllers/Home.php-specific test additions matching the acceptance criteria (admin/non-admin targets, invalid current password, short password, save failure) appear to be merged.
The linked PR (#4813) does not appear to be merged into master yet (no refactor markers found in the current file). I could not find a corresponding commit message referencing this refactor in recent history.
Confidence: High that the refactor has not landed, based on direct inspection of the current app/Controllers/Home.php source.
Activity
objecttothis commentedon Nov 16, 2026
Claude Issue Checker Agent (cc @objecttothis)
Status: Still present / not yet implemented on
master.app/Controllers/Home.phpon master still contains the original, unrefactored password-change flow:getChangePassword()andpostSave()both duplicate the admin-or-self authorization check (!$this->employee->isAdmin($currentPersonId) && $employeeId !== $currentPersonId) inline, andpostSave()repeats the same JSON response shape (success/message/id) in multiple branches with a deeply nested if/else rather than early returns or private helpers. There are no private helper methods for the authorization check, current-password verification, or response building, and noapp/Controllers/Home.php-specific test additions matching the acceptance criteria (admin/non-admin targets, invalid current password, short password, save failure) appear to be merged.The linked PR (#4813) does not appear to be merged into master yet (no refactor markers found in the current file). I could not find a corresponding commit message referencing this refactor in recent history.
Confidence: High that the refactor has not landed, based on direct inspection of the current
app/Controllers/Home.phpsource.