Skip to content

fix(password): support mediumRegex/strongRegex on pPassword directive - #1411

Open
rene-schakmann wants to merge 1 commit into
openng-org:mainfrom
rene-schakmann:fix/issue-953-password-directive-regex
Open

fix(password): support mediumRegex/strongRegex on pPassword directive#1411
rene-schakmann wants to merge 1 commit into
openng-org:mainfrom
rene-schakmann:fix/issue-953-password-directive-regex

Conversation

@rene-schakmann

@rene-schakmann rene-schakmann commented Jul 27, 2026

Copy link
Copy Markdown

Summary

  • pPassword directive used its own hardcoded scoring algorithm for password strength, unlike p-password which exposes mediumRegex/strongRegex inputs to control the weak/medium/strong thresholds.
  • Adds mediumRegex/strongRegex @Input()s to PasswordDirective (same defaults as the Password component) and switches testStrength()/onKeyup() to the same regex-based level detection used by the component, so both now behave identically and are equally configurable.

Fixes #953

Test plan

  • ng test optimus-ui --include='**/password/password.spec.ts' — 138/138 passing (updated directive tests to cover default and custom mediumRegex/strongRegex)
  • Manually verified in a running app: with mediumRegex="^(?=.{4,})" and strongRegex="^(?=.{8,})" bound on pPassword, typing 2/4/8 characters correctly shows Weak/Medium/Strong

Strong password state driven by custom strongRegex


Drafted with assistance from Claude Code.

The pPassword directive hardcoded its own scoring algorithm for
strength detection, unlike p-password which lets mediumRegex and
strongRegex control the weak/medium/strong thresholds. Add the same
inputs to the directive and switch its strength check to match the
component's regex-based approach.

Fixes openng-org#953
@rene-schakmann
rene-schakmann marked this pull request as draft July 27, 2026 19:14
@rene-schakmann
rene-schakmann marked this pull request as ready for review July 28, 2026 05:42
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.

Password: mediumRegex and strongRegex not available on pPassword directive

1 participant