Repository navigation
fix: prevent signup crashes when password policy is unavailable - #2874
Open
thduttonuk wants to merge 2 commits into
Open
thduttonuk wants to merge 2 commits into
thduttonuk wants to merge 2 commits into
Conversation
This branch has not been deployed
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.
Changes
When the selected connection has no password policy,
passwordStrengthPolicyreturns the string'none'. Password validation and strength rendering expect an Immutable policy and call.toJS(), so typing can crash and unmount the signup form.Remove the string fallback to use Lock's existing optional-policy behavior. Missing policies skip the client strength hint and leave validation to the server; configured policies continue to enforce their rules.
Add component regressions for unloaded connections, a database connection without a policy, an enterprise default directory, and a configured minimum password length.
References
Fixes #2873.
Related historical issue: #1612.
Testing
The three missing-policy regressions fail on unmodified master with
policy.toJS is not a functionand the password input removed. All four regressions pass with the fix.Verified on Node 22.23.1, matching the repository CI major:
npm test: 70 suites, 442 tests and 248 snapshots pass.npm run build,npm run test:es-checkandnpm run i18n:validate: pass.npm run test:e2ein headless Chrome 154: 112 tests pass, one skipped.npm run lintreports an existingreact/no-deprecatederror forReactDOM.unmountComponentAtNodeinsrc/ui/box.js:70. The same error was verified against that file from unmodified HEAD.The original live invitation failure was not reproduced end to end; these regressions exercise the actual selector, validator and password input component.
Checklist