fix: Negative values allowed by spinners of Login Lifetimes inputs (#8694)

# Which Problems Are Solved

Previously, the login lifetime input fields allowed negative values and,
in some cases, zero values, which were not valid according to the
business rules.

# How the Problems Are Solved

The issue was resolved by adding min and step properties to the relevant
HTML input fields. This ensures that only valid values are entered,
adhering to the specific requirements for each field.

Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
Mostafa Galal
2024-10-25 10:44:15 +02:00
committed by GitHub
co-authored by Max Peintner
parent 32d958ea43
commit 4eeb2be36a
@@ -155,7 +155,7 @@
>
<cnsl-form-field class="lifetime-form-field" label="Password Check Lifetime" required="true">
<cnsl-label>{{ 'DESCRIPTIONS.SETTINGS.LOGIN.LIFETIMES.LABEL' | translate }}</cnsl-label>
<input cnslInput type="number" name="passwordCheckLifetime" formControlName="passwordCheckLifetime" />
<input cnslInput type="number" name="passwordCheckLifetime" formControlName="passwordCheckLifetime" min="1" step="1" />
</cnsl-form-field>
</cnsl-card>
<cnsl-card
@@ -164,7 +164,14 @@
>
<cnsl-form-field class="lifetime-form-field" label="external Login Check Lifetime" required="true">
<cnsl-label>{{ 'DESCRIPTIONS.SETTINGS.LOGIN.LIFETIMES.LABEL' | translate }}</cnsl-label>
<input cnslInput type="number" name="externalLoginCheckLifetime" formControlName="externalLoginCheckLifetime" />
<input
cnslInput
type="number"
name="externalLoginCheckLifetime"
formControlName="externalLoginCheckLifetime"
min="1"
step="1"
/>
</cnsl-form-field>
</cnsl-card>
<cnsl-card
@@ -173,7 +180,7 @@
>
<cnsl-form-field class="lifetime-form-field" label="MFA Init Skip Lifetime" required="true">
<cnsl-label>{{ 'DESCRIPTIONS.SETTINGS.LOGIN.LIFETIMES.LABEL' | translate }}</cnsl-label>
<input cnslInput type="number" name="mfaInitSkipLifetime" formControlName="mfaInitSkipLifetime" />
<input cnslInput type="number" name="mfaInitSkipLifetime" formControlName="mfaInitSkipLifetime" min="0" step="1" />
</cnsl-form-field>
</cnsl-card>
<cnsl-card
@@ -182,7 +189,14 @@
>
<cnsl-form-field class="lifetime-form-field" label="Second Factor Check Lifetime" required="true">
<cnsl-label>{{ 'DESCRIPTIONS.SETTINGS.LOGIN.LIFETIMES.LABEL' | translate }}</cnsl-label>
<input cnslInput type="number" name="secondFactorCheckLifetime" formControlName="secondFactorCheckLifetime" />
<input
cnslInput
type="number"
name="secondFactorCheckLifetime"
formControlName="secondFactorCheckLifetime"
min="1"
step="1"
/>
</cnsl-form-field>
</cnsl-card>
<cnsl-card
@@ -191,7 +205,14 @@
>
<cnsl-form-field class="lifetime-form-field" label="Multi-factor Check Lifetime" required="true">
<cnsl-label>{{ 'DESCRIPTIONS.SETTINGS.LOGIN.LIFETIMES.LABEL' | translate }}</cnsl-label>
<input cnslInput type="number" name="multiFactorCheckLifetime" formControlName="multiFactorCheckLifetime" />
<input
cnslInput
type="number"
name="multiFactorCheckLifetime"
formControlName="multiFactorCheckLifetime"
min="1"
step="1"
/>
</cnsl-form-field>
</cnsl-card>
</form>