Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2.2 KiB
2.2 KiB
ADDED Requirements
Requirement: Change own password
The system SHALL let a signed-in admin change their own password by giving the current password, a new password and its confirmation. The new password SHALL pass the admin password rules and SHALL differ from the current one. On success the system SHALL keep the admin signed in, keep their first-login state complete, and record PASSWORD_CHANGED. An admin whose first-login password change is still pending SHALL use the first-login flow instead.
Scenario: Successful change
- WHEN
sales1gives the right current password and a new password that passes the rules, twice - THEN the new password works at the next sign-in and the old one does not
- AND
sales1stays signed in - AND a
PASSWORD_CHANGEDrecord is saved
Scenario: Confirmation differs
- WHEN the new password and its confirmation differ
- THEN the change is refused with
PASSWORD_MISMATCH
Scenario: Same as current
- WHEN the new password equals the current password
- THEN the change is refused with
PASSWORD_SAME
Scenario: Fails the rules
- WHEN the new password breaks an admin password rule
- THEN the change is refused with
PASSWORD_POLICY
Scenario: Pending first login
- GIVEN
sales1must still complete the first-login password change - WHEN
sales1calls change password - THEN the request is refused and
sales1is sent to the first-login flow
Requirement: Wrong current password counts as a failed sign-in
The system SHALL refuse a change whose current password is wrong with CURRENT_PASSWORD_WRONG, and SHALL record it as LOGIN_FAIL so that repeated wrong guesses lock the username. A locked username SHALL be refused with ACCOUNT_LOCKED before the current password is checked.
Scenario: Wrong current password
- WHEN
sales1gives a wrong current password - THEN the change is refused with
CURRENT_PASSWORD_WRONG - AND a
LOGIN_FAILrecord forsales1is saved
Scenario: Locked while changing
- GIVEN
sales1is locked - WHEN
sales1calls change password with the right current password - THEN the change is refused with
ACCOUNT_LOCKED - AND the password is unchanged