Skip to content

Clear require_password_change after password reset (follow-up to #1494) - #167

Open
aarshe22 wants to merge 1 commit into
projectsend:developfrom
aarshe22:fix/clear-require-password-change-on-reset
Open

Clear require_password_change after password reset (follow-up to #1494)#167
aarshe22 wants to merge 1 commit into
projectsend:developfrom
aarshe22:fix/clear-require-password-change-on-reset

Conversation

@aarshe22

@aarshe22 aarshe22 commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Fixes #168

Problem

  1. Admin creates a client with Require password change after first login.
  2. Client uses the email reset link and successfully sets a new password.
  3. require_password_change meta remains true.
  4. On login, password_change_required() still redirects to clients-edit.php?id=<id>.
  5. Even with the #1494 permission fix applied, users who already reset via email never clear the flag unless they save the profile form.

Changes

  • includes/Classes/PasswordReset.php — delete the meta after a successful reset.
  • includes/Classes/Users.php — also clear it inside setNewPassword() so all callers that set a password satisfy the requirement.

Test plan

  • Create a client with Require password change after first login enabled
  • Request a password reset email and complete the reset with a new password
  • Confirm require_password_change meta is removed for that user
  • Log in as the client and confirm redirect goes to the file list (not clients-edit.php)
  • Confirm a client without the flag is unchanged
  • Confirm creating a new client with the flag still sets the meta (create path does not use setNewPassword() before saving meta)

PR #1494 fixed the 403 on clients-edit.php for forced password changes, but email password reset still left the require_password_change meta set. Clients were then redirected to clients-edit on every login even after resetting via email.

Co-authored-by: Cursor <cursoragent@cursor.com>
@aarshe22

aarshe22 commented Sep 3, 2026

Copy link
Copy Markdown
Author

Opened tracking issue for this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

require_password_change not cleared after email password reset (follow-up to #1494 / #1476)

1 participant