TRUNK-6645: Prevent clearPasswords() from wiping wizard credentials mid-flow#6152
Open
solomonfortune wants to merge 5 commits into
Open
TRUNK-6645: Prevent clearPasswords() from wiping wizard credentials mid-flow#6152solomonfortune wants to merge 5 commits into
solomonfortune wants to merge 5 commits into
Conversation
jwnasambu
reviewed
Jun 3, 2026
Contributor
jwnasambu
left a comment
There was a problem hiding this comment.
@solomonfortune Kindly do you mind fixing the merge conflicts please?
…id-flow During first-time setup, any parameterless GET to /initialsetup (caused by a favicon request, redirect, refresh, or Back button) triggered clearPasswords() on the shared singleton wizardModel, blanking all password fields even after the user had entered them. Because SessionModelUtils deliberately excludes password fields from the session round-trip, the wiped values could not be restored, causing the background install thread to connect with an empty password and fail with 'Access denied (using password: NO)'. Fix: add a passwordsEntered flag to InitializationWizardModel that is set to true when the user submits credentials (simple or advanced path) and reset to false inside clearPasswords(). The page==null branch in doGet() now only calls clearPasswords() when the flag is false, i.e. before any credentials have been entered.
d40005f to
8099278
Compare
|
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.



Description of what I changed
Added a
passwordsEnteredflag toInitializationWizardModelthat is set totruewhen the user submits credentials in either the simple or advanced setup path, and reset tofalseinsideclearPasswords().The
page == nullbranch indoGet()now only callsclearPasswords()when the flag isfalse, i.e. before any credentials have been entered.Previously, any parameterless GET to
/initialsetup(caused by a favicon request, browser refresh, Back button, or StartupFilter redirect) would callclearPasswords()unconditionally on the shared singletonwizardModel, blanking all five password fields even after the user had already entered them.Since
SessionModelUtilsdeliberately excludes password fields from the session round-trip, the wiped values could not be restored, causing the background install thread to connect with an empty password and fail with:Access denied for user 'root'@'localhost' (using password: NO)Files changed:
InitializationWizardModel.java— addedpasswordsEnteredflagInitializationFilter.java— guardclearPasswords(), set flag on credential submission, reset flag insideclearPasswords()Issue I worked on
see https://issues.openmrs.org/browse/TRUNK-6645
Checklist: I completed these to help reviewers :)
mvn clean packageright before creating this pull request and added all formatting changes to my commit.