fix(login): respect password complexity settings in UI (#11528)

<!--
Please inform yourself about the contribution guidelines on submitting a
PR here:
https://github.com/zitadel/zitadel/blob/main/CONTRIBUTING.md#submit-a-pull-request-pr.
Take note of how PR/commit titles should be written and replace the
template texts in the sections below. Don't remove any of the sections.
It is important that the commit history clearly shows what is changed
and why.
Important: By submitting a contribution you agree to the terms from our
Licensing Policy as described here:
https://github.com/zitadel/zitadel/blob/main/LICENSING.md#community-contributions.
-->

# Which Problems Are Solved

- Login V2 UI displays all password complexity requirements (symbol,
number, uppercase, lowercase) regardless of the actual
instance/organization configuration
- Users see requirements they don't need to meet, causing confusion

# How the Problems Are Solved

- Updated the PasswordComplexity component to conditionally render each
requirement based on the corresponding `requires*` flag from the
password complexity settings
- Only enabled requirements are now displayed to users

# Additional Changes

None.

# Additional Context

- Closes #11511
This commit is contained in:
Liam Neville
2026-02-06 15:23:36 +01:00
committed by GitHub
parent 1f0d54a978
commit 4712d99856
2 changed files with 166 additions and 27 deletions
@@ -91,33 +91,39 @@ export function PasswordComplexity({
/>
</span>
</div>
) : (
<span />
) : null}
{passwordComplexitySettings.requiresSymbol && (
<div className="flex flex-row items-center" data-testid="symbol-check">
{renderIcon(hasSymbol, t)}
<span className={desc}>
<Translated i18nKey="complexity.hasSymbol" namespace="password" />
</span>
</div>
)}
{passwordComplexitySettings.requiresNumber && (
<div className="flex flex-row items-center" data-testid="number-check">
{renderIcon(hasNumber, t)}
<span className={desc}>
<Translated i18nKey="complexity.hasNumber" namespace="password" />
</span>
</div>
)}
{passwordComplexitySettings.requiresUppercase && (
<div className="flex flex-row items-center" data-testid="uppercase-check">
{renderIcon(hasUppercase, t)}
<span className={desc}>
<Translated i18nKey="complexity.hasUppercase" namespace="password" />
</span>
</div>
)}
{passwordComplexitySettings.requiresLowercase && (
<div className="flex flex-row items-center" data-testid="lowercase-check">
{renderIcon(hasLowercase, t)}
<span className={desc}>
<Translated i18nKey="complexity.hasLowercase" namespace="password" />
</span>
</div>
)}
<div className="flex flex-row items-center" data-testid="symbol-check">
{renderIcon(hasSymbol, t)}
<span className={desc}>
<Translated i18nKey="complexity.hasSymbol" namespace="password" />
</span>
</div>
<div className="flex flex-row items-center" data-testid="number-check">
{renderIcon(hasNumber, t)}
<span className={desc}>
<Translated i18nKey="complexity.hasNumber" namespace="password" />
</span>
</div>
<div className="flex flex-row items-center" data-testid="uppercase-check">
{renderIcon(hasUppercase, t)}
<span className={desc}>
<Translated i18nKey="complexity.hasUppercase" namespace="password" />
</span>
</div>
<div className="flex flex-row items-center" data-testid="lowercase-check">
{renderIcon(hasLowercase, t)}
<span className={desc}>
<Translated i18nKey="complexity.hasLowercase" namespace="password" />
</span>
</div>
<div className="flex flex-row items-center" data-testid="equal-check">
{renderIcon(equals, t)}
<span className={desc}>