Skip to content

fix: prevent signup crashes when password policy is unavailable - #2874

Open
thduttonuk wants to merge 2 commits into
auth0:masterfrom
thduttonuk:codex/fix-missing-password-policy
Open

thduttonuk wants to merge 2 commits into
auth0:masterfrom
thduttonuk:codex/fix-missing-password-policy

Conversation

@thduttonuk

Copy link
Copy Markdown
Contributor

Changes

When the selected connection has no password policy, passwordStrengthPolicy returns 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 function and 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-check and npm run i18n:validate: pass.
  • npm run test:e2e in headless Chrome 154: 112 tests pass, one skipped.
  • ESLint with zero warnings and Prettier checks pass for both changed files.
  • Full npm run lint reports an existing react/no-deprecated error for ReactDOM.unmountComponentAtNode in src/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.

  • This change adds unit test coverage
  • This change adds integration test coverage
  • This change has been tested on the latest version of the platform/language (tested the CI's Node 22 major)

Checklist

  • I have read the Auth0 general contribution guidelines
  • I have read the Auth0 Code of Conduct
  • All code quality tools/guidelines have been run/followed (existing repository lint error noted above)
  • All relevant assets have been compiled

@thduttonuk
thduttonuk requested a review from a team as a code owner October 1, 2026 15:28

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signup crashes with "policy.toJS is not a function" when password policy is unavailable (15.0.1)

1 participant