Skip to content

fix(occ): dispatch password reset events for user:resetpassword - #64764

Open
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-occ-pwReset-events
Open

joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-occ-pwReset-events

Conversation

@joshtrichards

Copy link
Copy Markdown
Member

Summary

Emit BeforePasswordResetEvent before setting the password and PasswordResetEvent only after the password change succeeds. Emitting these events is the correct lifecycle behavior and lets server-side encryption use its reset flow instead of treating the CLI operation as a normal password change, matching the web-based lost-password flow.

Because this command does not provide an encryption recovery password, existing encrypted files may become inaccessible after the reset. The interactive CLI and web flow warn about this; the --password-from-env path does not, which is existing behavior.

TODO

  • Backport?

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Emit BeforePasswordResetEvent before setting the password and PasswordResetEvent only after the password change succeeds. Emitting these events is the correct lifecycle behavior and lets server-side encryption use its reset flow instead of treating the CLI operation as a normal password change, matching the web-based lost-password flow.

Because this command does not provide an encryption recovery password, existing encrypted files may become inaccessible after the reset. The
interactive CLI and web flow warn about this; the --password-from-env path does not, which is existing behavior.

Fixes #51235

Signed-off-by: Josh <josh.t.richards@gmail.com>
Verify that user:resetpassword dispatches reset events around a successful password change and does not dispatch PasswordResetEvent when the change fails.

Assisted-by: Copilot:gpt-6-luna

Signed-off-by: Josh <josh.t.richards@gmail.com>

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

occ user:resetpassword fails when server-side encryption is enabled

3 participants