feat: require current password when changing password (#3120)#3980
Open
FloodExLLC wants to merge 1 commit intoconversejs:masterfrom
Open
feat: require current password when changing password (#3120)#3980FloodExLLC wants to merge 1 commit intoconversejs:masterfrom
FloodExLLC wants to merge 1 commit intoconversejs:masterfrom
Conversation
…js#3120) Add a "Current password" field to the password reset form to prevent unauthorized password changes when someone has access to the browser. The current password is verified client-side against the stored connection password when available. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jcbrand
reviewed
Mar 23, 2026
| const form_data = new FormData(ev.target.form ?? ev.target); | ||
| const current_password = form_data.get('current_password'); | ||
| const connection = api.connection.get(); | ||
| if (connection?.pass && current_password !== connection.pass) { |
Member
There was a problem hiding this comment.
This isn't going to work in all cases. When you reconnected via BOSH or XEP-0198 then the password won't be set on the connection object.
Member
There was a problem hiding this comment.
To properly test the existing password, you might have to create a new Strophe.Connection object (using the subclass in Converse is likely overkill) and then test logging in with that connection and the provided password.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
src/plugins/profile/password-reset.js: Addedcurrent_password_errorproperty andcheckCurrentPassword()methodsrc/plugins/profile/templates/password-reset.js: Added "Current password" input field with error displaysrc/plugins/profile/tests/password-reset.js: Added test for incorrect current password, updated helper to include current passwordTest plan
secret)required)?? Generated with Claude Code