fix(password): support mediumRegex/strongRegex on pPassword directive - #1411
Open
rene-schakmann wants to merge 1 commit into
Open
fix(password): support mediumRegex/strongRegex on pPassword directive#1411rene-schakmann wants to merge 1 commit into
rene-schakmann wants to merge 1 commit into
Conversation
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
marked this pull request as draft
July 27, 2026 19:14
rene-schakmann
marked this pull request as ready for review
July 28, 2026 05:42
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
pPassworddirective used its own hardcoded scoring algorithm for password strength, unlikep-passwordwhich exposesmediumRegex/strongRegexinputs to control the weak/medium/strong thresholds.mediumRegex/strongRegex@Input()s toPasswordDirective(same defaults as thePasswordcomponent) and switchestestStrength()/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 custommediumRegex/strongRegex)mediumRegex="^(?=.{4,})"andstrongRegex="^(?=.{8,})"bound onpPassword, typing 2/4/8 characters correctly shows Weak/Medium/StrongDrafted with assistance from Claude Code.